summaryrefslogtreecommitdiff
path: root/boost/assign/ptr_map_inserter.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/assign/ptr_map_inserter.hpp')
-rw-r--r--boost/assign/ptr_map_inserter.hpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/boost/assign/ptr_map_inserter.hpp b/boost/assign/ptr_map_inserter.hpp
index fb180f28fd..efe5d87413 100644
--- a/boost/assign/ptr_map_inserter.hpp
+++ b/boost/assign/ptr_map_inserter.hpp
@@ -18,6 +18,15 @@
#include <boost/assign/list_inserter.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/move/utility.hpp>
+
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/iteration/local.hpp>
+
+#endif
namespace boost
{
@@ -38,7 +47,9 @@ namespace assign
ptr_map_inserter( PtrMap& m ) : m_( m )
{}
-
+
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
template< class Key >
ptr_map_inserter& operator()( const Key& t )
{
@@ -68,6 +79,16 @@ namespace assign
#include BOOST_PP_LOCAL_ITERATE()
+#else
+ template< class Key, class... Ts >
+ ptr_map_inserter& operator()(Key&& k, Ts&&... ts)
+ {
+ key_type key(boost::forward<Key>(k));
+ m_.insert(key, new obj_type(boost::forward<Ts>(ts)...));
+ return *this;
+ }
+
+#endif
private:
ptr_map_inserter& operator=( const ptr_map_inserter& );
@@ -95,9 +116,13 @@ namespace assign
} // namespace 'assign'
} // namespace 'boost'
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
#undef BOOST_ASSIGN_PARAMS1
#undef BOOST_ASSIGN_PARAMS2
#undef BOOST_ASSIGN_PARAMS3
#undef BOOST_ASSIGN_MAX_PARAMETERS
#endif
+
+#endif