Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1.  
  2.     class K {
  3.     public:
  4.         K() { }
  5.         K& operator=(const K&) { printf("copy assigment\n"); return *this; }
  6.         K& operator=(K&&) { printf("move assignment\n"); return *this; }
  7.     };
  8.  
  9.     inline void fun(const K& k) {
  10.         K p;
  11.         p = k;
  12.     }
  13.  
  14.     inline void fun(K&& k) {
  15.         K p;
  16.         p = k;
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement