diff --git a/include/boost/foreach.hpp b/include/boost/foreach.hpp index 12c75ea..6524a86 100755 --- a/include/boost/foreach.hpp +++ b/include/boost/foreach.hpp @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -129,8 +130,15 @@ namespace foreach // This also tells BOOST_FOREACH to avoid the rvalue/lvalue detection stuff. template struct is_noncopyable - #ifndef BOOST_BROKEN_IS_BASE_AND_DERIVED + #if !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED) && !defined(BOOST_NO_IS_ABSTRACT) + : boost::mpl::or_< + boost::is_abstract + , boost::is_base_and_derived + > + #elif !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED) : boost::is_base_and_derived + #elif !defined(BOOST_NO_IS_ABSTRACT) + : boost::is_abstract #else : boost::mpl::false_ #endif @@ -356,8 +364,11 @@ inline T &derefof(T *t) template struct rvalue_probe { + struct private_type_ {}; // can't ever return an array by value - typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_, int, T>::type value_type; + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< + boost::mpl::or_, boost::is_array >, private_type_, T + >::type value_type; operator value_type(); operator T &() const; };