Is move constructor necessary on (POD) structs?
c++, constructor, move
Solution
Yes, it will work without the need of specifying the move constructor; in your example, it is possible that the compiler optimizes the move operation by initializing lala instead of test; check the assembler output about that.
Problem
In Paragraph 12.8/15 of the C++11 Standard is defined: The implicitly-defined copy/move constructor for a non-union class X performs a memberwise copy/move of its bases and members. [...] Does this mean that: ``` struct st { int a; int b; // ... }; // ... void do_smt(st tmp) { st lala(std::move(tmp)); // ... } // ... int main(int argc, char* argv[]) { st test(1, 2); do_smt(std::move(test)); } ``` would work without the move constructor?