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
Strings
Workaround for https://github.com/Project-OSRM/osrm-backend/pull/4385
bitfields_msvc
vc++ bug?
hangman
#10.1
map_file_mangling
infix to postfix v 1.0
Say if number is prime and give its factors
5sdgts