Ticket #6396: Implicit instanciation of boost::rv for non-cass types generates an error

[SVN r76509]
This commit is contained in:
Ion Gaztañaga
2012-01-15 12:25:12 +00:00
parent fcc47ebe1e
commit 7c1dcd51f6

View File

@ -225,13 +225,32 @@
namespace boost {
namespace move_detail {
template<class T>
struct is_class_or_union
{
struct twochar { char _[2]; };
template <class U>
static char is_class_or_union_tester(void(U::*)(void));
template <class U>
static twochar is_class_or_union_tester(...);
static const bool value = sizeof(is_class_or_union_tester<T>(0)) == sizeof(char);
};
struct empty{};
}
//////////////////////////////////////////////////////////////////////////////
//
// struct rv
//
//////////////////////////////////////////////////////////////////////////////
template <class T>
class rv : public T
class rv
: public BOOST_MOVE_MPL_NS::if_c
< ::boost::move_detail::is_class_or_union<T>::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