daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // &mut u8を引数に取り、&u8を返す関数を受け取る
  2. fn test<F: Fn(&mut u8) -> &u8>(f: F) {
  3.     f(&mut 0);
  4. }
  5.  
  6. fn main() {
  7.     test(|x| x);
  8.     // identityだとエラー
  9.     // test(std::convert::identity);
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top