[move] const rvalue failure.
The following fails to compile on both g++ 4.8.2 and VS2005 using Boost
1.56:
#include
On Sun, 24 Aug 2014 17:03:15 -0700, Mostafa
The following fails to compile on both g++ 4.8.2 and VS2005 using Boost 1.56:
#include
#include struct MOC { MOC() : value(121) {} MOC(BOOST_RV_REF(MOC) rhs) : value(rhs.value) {} int value; private: //Declared and purposefully not defined. MOC & operator=(MOC); private: BOOST_MOVABLE_BUT_NOT_COPYABLE(MOC) };
MOC moveonlyMutableRValue() { return MOC(); }
MOC const moveonlyConstRValue() { return MOC(); }
int main() { MOC m(moveonlyConstRValue());
return 0; }
Forgot to add that replacing "MOC m(moveonlyConstRValue());" with "MOC m(moveonlyMutableRValue())" compiles on both compilers.
On Sun, 24 Aug 2014 17:18:49 -0700, Mostafa
participants (1)
-
Mostafa