
Michel Morin wrote:
The following code works well (incl. your mentioned cases) both in C++03 and C++11 on gcc. <snip> static bool const rval_to_nonconst_lval_ref_conv = ::boost::type_traits::ice_and< !(::boost::is_function<From>::value) // Note: an rvalue ref to function type is an lvalue , !(::boost::is_reference<From>::value) , ::boost::is_reference<To>::value , !(::boost::is_const<typename ::boost::remove_reference<To>::type>::value) >::value;
Sorry, the above code is wrong. It does not detect binding const volatile reference to an rvalue. Here is a right code: static bool const rval_to_nonconst_lval_ref_conv = ::boost::type_traits::ice_and< !(::boost::is_function<From>::value) // Note: an rvalue ref to function type is an lvalue , !(::boost::is_reference<From>::value) , ::boost::is_reference<To>::value , ::boost::type_traits::ice_or< !::boost::is_const<typename ::boost::remove_reference<To>::type>::value , ::boost::type_traits::ice_and< ::boost::is_const<typename ::boost::remove_reference<To>::type>::value , ::boost::is_volatile<typename ::boost::remove_reference<To>::type>::value >::value >::value >::value; Regards, Michel