diff options
Diffstat (limited to 'boost/function/function_template.hpp')
-rw-r--r-- | boost/function/function_template.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/boost/function/function_template.hpp b/boost/function/function_template.hpp index 7984c8323f..0b05940b22 100644 --- a/boost/function/function_template.hpp +++ b/boost/function/function_template.hpp @@ -590,12 +590,21 @@ namespace boost { assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_) const { typedef functor_wrapper<FunctionObj,Allocator> functor_wrapper_type; +#if defined(BOOST_NO_CXX11_ALLOCATOR) typedef typename Allocator::template rebind<functor_wrapper_type>::other wrapper_allocator_type; typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type; +#else + using wrapper_allocator_type = typename std::allocator_traits<Allocator>::template rebind_alloc<functor_wrapper_type>; + using wrapper_allocator_pointer_type = typename std::allocator_traits<wrapper_allocator_type>::pointer; +#endif wrapper_allocator_type wrapper_allocator(a); wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); +#if defined(BOOST_NO_CXX11_ALLOCATOR) wrapper_allocator.construct(copy, functor_wrapper_type(f,a)); +#else + std::allocator_traits<wrapper_allocator_type>::construct(wrapper_allocator, copy, functor_wrapper_type(f,a)); +#endif functor_wrapper_type* new_f = static_cast<functor_wrapper_type*>(copy); functor.members.obj_ptr = new_f; } |