diff --git a/include/boost/move/move.hpp b/include/boost/move/move.hpp index 284c58e..4d510f4 100644 --- a/include/boost/move/move.hpp +++ b/include/boost/move/move.hpp @@ -225,13 +225,32 @@ namespace boost { + namespace move_detail { + template + struct is_class_or_union + { + struct twochar { char _[2]; }; + template + static char is_class_or_union_tester(void(U::*)(void)); + template + static twochar is_class_or_union_tester(...); + static const bool value = sizeof(is_class_or_union_tester(0)) == sizeof(char); + }; + struct empty{}; + } + ////////////////////////////////////////////////////////////////////////////// // // struct rv // ////////////////////////////////////////////////////////////////////////////// template - class rv : public T + class rv + : public BOOST_MOVE_MPL_NS::if_c + < ::boost::move_detail::is_class_or_union::value + , T + , ::boost::move_detail::empty + >::type { rv(); ~rv(); @@ -239,6 +258,8 @@ void operator=(rv const&); } BOOST_MOVE_ATTRIBUTE_MAY_ALIAS; + + ////////////////////////////////////////////////////////////////////////////// // // move_detail::is_rv