Original Post
Is this intended?
Output:
(Compiled with GCC 4.6)
Shouldn't the foo[] array members be moved, just like the regular member? or is this correct?
I have a workaround if it's correct, but it just seems kind-of inconsistent.
Thanks.
#include <iostream>struct CFoo { CFoo() =default; CFoo(const CFoo&) { std::cout << "copy" << std::endl; } CFoo(CFoo&&) { std::cout << "move" << std::endl; } };struct CBar { CBar() =default; CBar(const CBar&) =default; CBar(CBar&&) =default; CFoo foo[2]; CFoo f; };int main() { CBar b = std::move(CBar()); };copycopymoveShouldn't the foo[] array members be moved, just like the regular member? or is this correct?
I have a workaround if it's correct, but it just seems kind-of inconsistent.
Thanks.