From e0054c7dd0dae53e57ae3414e6c786d3798b6ac6 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 18 Apr 2017 10:14:26 +0100 Subject: [PATCH] Remove alloc parameter from construct_value --- .../boost/unordered/detail/implementation.hpp | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 4741170a..95502fe0 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -1270,37 +1270,36 @@ namespace func { #elif !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -template -inline void construct_value(Alloc&, T* address, BOOST_FWD_REF(Args)... args) +template +inline void construct_value(T* address, BOOST_FWD_REF(Args)... args) { new ((void*)address) T(boost::forward(args)...); } #define BOOST_UNORDERED_CALL_CONSTRUCT0(Traits, alloc, address) \ - boost::unordered::detail::func::construct_value(alloc, address) + boost::unordered::detail::func::construct_value(address) #define BOOST_UNORDERED_CALL_CONSTRUCT1(Traits, alloc, address, a0) \ - boost::unordered::detail::func::construct_value(alloc, address, a0) + boost::unordered::detail::func::construct_value(address, a0) #define BOOST_UNORDERED_CALL_DESTROY(Traits, alloc, x) \ boost::unordered::detail::func::destroy(x) #else -template -inline void construct_value(Alloc&, T* address) +template inline void construct_value(T* address) { new ((void*)address) T(); } -template -inline void construct_value(Alloc&, T* address, BOOST_FWD_REF(A0) a0) +template +inline void construct_value(T* address, BOOST_FWD_REF(A0) a0) { new ((void*)address) T(boost::forward(a0)); } #define BOOST_UNORDERED_CALL_CONSTRUCT0(Traits, alloc, address) \ - boost::unordered::detail::func::construct_value(alloc, address) + boost::unordered::detail::func::construct_value(address) #define BOOST_UNORDERED_CALL_CONSTRUCT1(Traits, alloc, address, a0) \ - boost::unordered::detail::func::construct_value(alloc, address, a0) + boost::unordered::detail::func::construct_value(address, a0) #define BOOST_UNORDERED_CALL_DESTROY(Traits, alloc, x) \ boost::unordered::detail::func::destroy(x) @@ -1796,12 +1795,12 @@ construct_node_pair(Alloc& alloc, BOOST_FWD_REF(Key) k) { node_constructor a(alloc); a.create_node(); - boost::unordered::detail::func::construct_value(alloc, + boost::unordered::detail::func::construct_value( boost::addressof(a.node_->value_ptr()->first), boost::forward(k)); BOOST_TRY { boost::unordered::detail::func::construct_value( - alloc, boost::addressof(a.node_->value_ptr()->second)); + boost::addressof(a.node_->value_ptr()->second)); } BOOST_CATCH(...) { @@ -1819,11 +1818,11 @@ construct_node_pair(Alloc& alloc, BOOST_FWD_REF(Key) k, BOOST_FWD_REF(Mapped) m) { node_constructor a(alloc); a.create_node(); - boost::unordered::detail::func::construct_value(alloc, + boost::unordered::detail::func::construct_value( boost::addressof(a.node_->value_ptr()->first), boost::forward(k)); BOOST_TRY { - boost::unordered::detail::func::construct_value(alloc, + boost::unordered::detail::func::construct_value( boost::addressof(a.node_->value_ptr()->second), boost::forward(m)); } @@ -1844,7 +1843,7 @@ construct_node_pair_from_args( { node_constructor a(alloc); a.create_node(); - boost::unordered::detail::func::construct_value(alloc, + boost::unordered::detail::func::construct_value( boost::addressof(a.node_->value_ptr()->first), boost::forward(k)); BOOST_TRY {