Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
primitive type copy constructor
#include <cassert> #include <iostream> struct MyClass { int m = 0; }; MyClass& f(MyClass& x) { x.m++; return x; } inline MyClass f(MyClass&& x) { return f(x); } int& f(int& x) { x++; return x; } inline int f(int&& x) { return f(x); } int main() { MyClass x1; auto y1 = f(MyClass(x1)); // Result: x1.m = 0, y1.m = 1 int x2 = 0; auto y2 = f(int(x2)); // Result: x2 = 1, y2 = 1 std::cout << x1.m << x2; //assert(x1.m == x2); // FAILED!!! return 0; }
run
|
edit
|
history
|
help
0
Even Odd
problem_solution_1
MSVC14 <experimental/generator> header
upper_bound With binary_function Visual Studio 2008 Bug?
Workaround for https://github.com/Project-OSRM/osrm-backend/pull/4385
"Mostly invalid states" and unordered_set
VC typeid example
PRIx64 on MSVC
ordinary queue
seh exception