diff --git a/include/boost/container/detail/advanced_insert_int.hpp b/include/boost/container/detail/advanced_insert_int.hpp index 4d00d7a..1296659 100644 --- a/include/boost/container/detail/advanced_insert_int.hpp +++ b/include/boost/container/detail/advanced_insert_int.hpp @@ -386,6 +386,8 @@ struct BOOST_PP_CAT(insert_emplace_proxy_arg, N) #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + //Specializations to avoid an unneeded temporary when emplacing from a single argument o type value_type template struct insert_emplace_proxy_arg1::value_type> > @@ -404,7 +406,37 @@ struct insert_emplace_proxy_arg1(v) {} }; -/* + +#else //e.g. MSVC10 & MSVC11 + +//Specializations to avoid an unneeded temporary when emplacing from a single argument o type value_type +template +struct insert_emplace_proxy_arg1::value_type> + : public insert_move_proxy +{ + explicit insert_emplace_proxy_arg1(typename boost::container::allocator_traits::value_type &&v) + : insert_move_proxy(v) + {} +}; + +template +struct insert_emplace_proxy_arg1::value_type &> + : public insert_copy_proxy +{ + explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) + : insert_copy_proxy(v) + {} +}; + +template +struct insert_emplace_proxy_arg1::value_type &> + : public insert_copy_proxy +{ + explicit insert_emplace_proxy_arg1(const typename boost::container::allocator_traits::value_type &v) + : insert_copy_proxy(v) + {} +}; + template struct insert_emplace_proxy_arg1::value_type> : public insert_copy_proxy @@ -413,7 +445,9 @@ struct insert_emplace_proxy_arg1(v) {} }; -*/ + +#endif + }}} //namespace boost { namespace container { namespace container_detail { #endif //#ifdef BOOST_CONTAINER_PERFECT_FORWARDING