Created attachment 22482 [details] Complete example code. Compile with 4.6 or higher using -std=c++0x. N3126: § 12.8.17 [move constructors]: --(3): "an array is initialized by moving each element in the manner appropriate to the element type" If you have a class with a member array and you call the default move constructor for said class, the move constructor COPIES said array elements. From what the standard says, it seems it should MOVE these elements. VERSION: 4.6.0 20100529 (experimental) (GCC) 4.5.1 is unable to explicitly default the move constructor. I don't have any other functional versions between these two. NOTE: I have added Pedro Lamarão's patch http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00620.html to my 4.6.0 but I can't see this affecting anything. TARGET: x86_64-unknown-linux-gnu SYSTEM: Core2Duo / Ubuntu(64) 10.4. ATTACHMENT: Compiles OK with -std=c++0x. OUTPUT: copy copy move PROBLEM: According to the C++ spec (ver N3126), I think the first 2 "copy"s should be "move"s.
dup of PR 46103 which was fixed last month if you want to test the latest development version you shouldn't use a build from 6 months ago *** This bug has been marked as a duplicate of bug 46103 ***
Sorry about that. All that work and I didn't even notice my test GCC was the wrong one.
you should definitely try a recent snapshot, there's been a lot of work on move support and g++ is pretty close to the n3126 definitions (although those aren't set in stone yet and might change)