onilink_

Untitled

Mar 25th, 2020
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.15 KB | None | 0 0
  1.     using X = int;
  2.     X x;
  3.     std::function<void(void)> foo;
  4.     {
  5.         X& ref = x;
  6.         foo = [&ref](){ ref = 123; };
  7.     }
  8.     foo();
Advertisement
Add Comment
Please, Sign In to add comment