Re: std::move() does not move a constant of a class type

2010-11-27 Thread Roman Kononov
On 2010-11-27, 20:22:02 -0600, Roman Kononov wrote: > Should this one emit the same error then? 4.6 compiles it. > > typedef int X; > X test() { >X const& a={}; >return std::move(a); > } Never mind. I've figured it out. Thanks.

Re: std::move() does not move a constant of a class type

2010-11-27 Thread Roman Kononov
On 2010-11-27, 16:37:07 -0800, James Dennett wrote: > 4.6 appears to be right -- you cannot bind an X&& to a const X (which > is good, as otherwise you could change the const X). Should this one emit the same error then? 4.6 compiles it. typedef int X; X test() { X const& a={}; return std:

Re: std::move() does not move a constant of a class type

2010-11-27 Thread James Dennett
On Sat, Nov 27, 2010 at 4:13 PM, Roman Kononov wrote: > Hello, > > Is it a bug or am I missing something? > > $ cat test.cpp > #include > > struct X { >   X()=default; >   X(X&&)=default; > }; > > X test() { >   X const a={}; >   return std::move(a); > } > > $ g++ -c -std=c++0x test.cpp > test.cp

std::move() does not move a constant of a class type

2010-11-27 Thread Roman Kononov
Hello, Is it a bug or am I missing something? $ cat test.cpp #include struct X { X()=default; X(X&&)=default; }; X test() { X const a={}; return std::move(a); } $ g++ -c -std=c++0x test.cpp test.cpp: In function 'X test()': test.cpp:10:22: error: no matching function for call