Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
move swap
#include <iostream> #include <utility> using namespace std; struct Foo { Foo() = default; Foo(const Foo &) { cout << "copy ctor" << endl; } Foo(Foo &&) { cout << "move ctor" << endl; } Foo &operator=(const Foo &) { cout << "copy =" << endl; return *this; } Foo &operator=(Foo &&) { cout << "move =" << endl; return *this; } }; int main() { Foo a, b; cout << "swap(a, b)" << endl; swap(a, b); cout << "swap(move(a), move(b))" << endl; swap(move(a), move(b)); return 0; }
run
|
edit
|
history
|
help
0
Build char string (multibyte) with wchar
Iterate_Variac_Template
Revers find file in windows
std::is_same doesn't check for calling convention
virtual test
infix to postfix v 3.0 with improved eval()
dharm1
Runner-mt
MSVC-IsBaseOf
Compile time creation of class member stl container (const std::array) filled with elements.