
2 Nov
2009
2 Nov
'09
8:08 p.m.
DE wrote:
Mathias Gaunard wrote:
Boost.Move is actually fairly similar to what you are proposing. well, to this point i still think that a temporary<type> better reflects the underlying semantics than, i guess, BOOST_RV_REF(type) (looks extremely ugly)
Boost.Move is really similar to what you are proposing, but it also handles the case that the compiler actually supports rvalue-references. So BOOST_RV_REF is a macro defined as: #ifdef BOOST_HAS_RVALUE_REFS #define BOOST_RV_REF(TYPE) TYPE && #else #define BOOST_RV_REF(TYPE) boost::rv< TYPE >& #endif It is true that macros always look ugly, but this is exactly the situation where you have to use a macro to abstract away unavoidable language differences. Regards, Thomas