From f088a5b9b9fbdbe24e1eda3cb3142ce67c1296de Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 29 Aug 2023 11:28:55 -0700 Subject: [PATCH] Remove usage of `boost::forward` --- doc/unordered/concurrent_flat_map.adoc | 26 +-- doc/unordered/unordered_flat_map.adoc | 36 ++-- doc/unordered/unordered_map.adoc | 36 ++-- doc/unordered/unordered_node_map.adoc | 36 ++-- .../boost/unordered/detail/implementation.hpp | 26 +-- include/boost/unordered/unordered_map.hpp | 172 +++++++++--------- include/boost/unordered/unordered_set.hpp | 70 +++---- test/objects/cxx11_allocator.hpp | 2 +- test/objects/exception.hpp | 4 +- test/objects/minimal.hpp | 6 +- test/objects/test.hpp | 4 +- test/unordered/scary_tests.cpp | 4 +- 12 files changed, 211 insertions(+), 211 deletions(-) diff --git a/doc/unordered/concurrent_flat_map.adoc b/doc/unordered/concurrent_flat_map.adoc index a2b28c9c..8dd00479 100644 --- a/doc/unordered/concurrent_flat_map.adoc +++ b/doc/unordered/concurrent_flat_map.adoc @@ -1045,13 +1045,13 @@ if there is an element with an equivalent key; otherwise, the construction is of ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` unlike xref:#concurrent_flat_map_emplace[emplace], which simply forwards all arguments to ``value_type``'s constructor. @@ -1093,13 +1093,13 @@ if there is an element with an equivalent key; otherwise, the construction is of ```c++ // first four overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // last two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` Invalidates pointers and references to elements if a rehashing is issued. @@ -1121,19 +1121,19 @@ template bool insert_or_assign(K&& k, M&& obj); Inserts a new element into the table or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the table as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` [horizontal] diff --git a/doc/unordered/unordered_flat_map.adoc b/doc/unordered/unordered_flat_map.adoc index 7518ba09..f637279d 100644 --- a/doc/unordered/unordered_flat_map.adoc +++ b/doc/unordered/unordered_flat_map.adoc @@ -909,13 +909,13 @@ if there is an element with an equivalent key; otherwise, the construction is of ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` unlike xref:#unordered_flat_map_emplace[emplace], which simply forwards all arguments to ``value_type``'s constructor. @@ -954,13 +954,13 @@ if there is an element with an equivalent key; otherwise, the construction is of ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` unlike xref:#unordered_flat_map_emplace_hint[emplace_hint], which simply forwards all arguments to ``value_type``'s constructor. @@ -985,19 +985,19 @@ template Inserts a new element into the container or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the container as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` [horizontal] @@ -1023,19 +1023,19 @@ template Inserts a new element into the container or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the container as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` `hint` is a suggestion to where the element should be inserted. This implementation ignores it. diff --git a/doc/unordered/unordered_map.adoc b/doc/unordered/unordered_map.adoc index d01944a0..121d5389 100644 --- a/doc/unordered/unordered_map.adoc +++ b/doc/unordered/unordered_map.adoc @@ -1034,13 +1034,13 @@ Notes:;; This function is similiar to xref:#unordered_map_emplace[emplace] excep ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` instead of xref:#unordered_map_emplace[emplace] which simply forwards all arguments to ``value_type``'s constructor. @@ -1083,13 +1083,13 @@ Notes:;; This function is similiar to xref:#unordered_map_emplace_hint[emplace_h ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` instead of xref:#unordered_map_emplace_hint[emplace_hint] which simply forwards all arguments to ``value_type``'s constructor. @@ -1121,19 +1121,19 @@ template Inserts a new element into the container or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the container as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` [horizontal] @@ -1161,19 +1161,19 @@ template Inserts a new element into the container or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the container as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` `hint` is a suggestion to where the element should be inserted. diff --git a/doc/unordered/unordered_node_map.adoc b/doc/unordered/unordered_node_map.adoc index 8e973e5a..d746261b 100644 --- a/doc/unordered/unordered_node_map.adoc +++ b/doc/unordered/unordered_node_map.adoc @@ -962,13 +962,13 @@ if there is an element with an equivalent key; otherwise, the construction is of ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` unlike xref:#unordered_node_map_emplace[emplace], which simply forwards all arguments to ``value_type``'s constructor. @@ -1007,13 +1007,13 @@ if there is an element with an equivalent key; otherwise, the construction is of ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)) ``` unlike xref:#unordered_node_map_emplace_hint[emplace_hint], which simply forwards all arguments to ``value_type``'s constructor. @@ -1038,19 +1038,19 @@ template Inserts a new element into the container or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the container as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` [horizontal] @@ -1076,19 +1076,19 @@ template Inserts a new element into the container or updates an existing one by assigning to the contained value. -If there is an element with key `k`, then it is updated by assigning `boost::forward(obj)`. +If there is an element with key `k`, then it is updated by assigning `std::forward(obj)`. If there is no such element, it is added to the container as: ```c++ // first two overloads value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) // third overload value_type(std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(obj))) + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(obj))) ``` `hint` is a suggestion to where the element should be inserted. This implementation ignores it. diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index c9033cd9..e132b2c9 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -665,7 +665,7 @@ namespace boost { Alloc& alloc, T* address, BOOST_FWD_REF(Args)... args) { boost::allocator_construct( - alloc, address, boost::forward(args)...); + alloc, address, std::forward(args)...); } // For backwards compatibility, implement a special case for @@ -867,7 +867,7 @@ namespace boost { value_allocator val_alloc(alloc); boost::allocator_construct( - val_alloc, a.node_->value_ptr(), boost::forward(x)); + val_alloc, a.node_->value_ptr(), std::forward(x)); return a.release(); } @@ -887,7 +887,7 @@ namespace boost { boost::allocator_construct(val_alloc, a.node_->value_ptr(), std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), + std::forward_as_tuple(std::forward(k)), std::forward_as_tuple()); return a.release(); } @@ -909,8 +909,8 @@ namespace boost { boost::allocator_construct(val_alloc, a.node_->value_ptr(), std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(m))); + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(m))); return a.release(); } @@ -931,8 +931,8 @@ namespace boost { boost::allocator_construct(val_alloc, a.node_->value_ptr(), std::piecewise_construct, - std::forward_as_tuple(boost::forward(k)), - std::forward_as_tuple(boost::forward(args)...)); + std::forward_as_tuple(std::forward(k)), + std::forward_as_tuple(std::forward(args)...)); return a.release(); } @@ -941,7 +941,7 @@ namespace boost { inline typename boost::allocator_pointer::type construct_node_from_key(T*, Alloc& alloc, BOOST_FWD_REF(Key) k) { - return construct_node(alloc, boost::forward(k)); + return construct_node(alloc, std::forward(k)); } template @@ -949,7 +949,7 @@ namespace boost { construct_node_from_key( std::pair*, Alloc& alloc, BOOST_FWD_REF(Key) k) { - return construct_node_pair(alloc, boost::forward(k)); + return construct_node_pair(alloc, std::forward(k)); } } // namespace func } // namespace detail @@ -2126,7 +2126,7 @@ namespace boost { value_type* dispatch = BOOST_NULLPTR; node_tmp tmp(detail::func::construct_node_from_key( - dispatch, alloc, boost::forward(k)), + dispatch, alloc, std::forward(k)), alloc); if (size_ + 1 > max_load_) { @@ -2201,13 +2201,13 @@ namespace boost { node_pointer p = this->find_node_impl(k, itb); if (p) { - p->value().second = boost::forward(obj); + p->value().second = std::forward(obj); return emplace_return(iterator(p, itb), false); } node_tmp b(boost::unordered::detail::func::construct_node_pair( - this->node_alloc(), boost::forward(k), - boost::forward(obj)), + this->node_alloc(), std::forward(k), + std::forward(obj)), node_alloc()); if (size_ + 1 > max_load_) { diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 74666dcd..4e744b5b 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -226,8 +226,8 @@ namespace boost { std::pair emplace(BOOST_FWD_REF(Args)... args) { return table_.emplace_unique( - table::extractor::extract(boost::forward(args)...), - boost::forward(args)...); + table::extractor::extract(std::forward(args)...), + std::forward(args)...); } #else @@ -252,9 +252,9 @@ namespace boost { std::pair emplace(BOOST_FWD_REF(A0) a0) { return table_.emplace_unique( - table::extractor::extract(boost::forward(a0)), + table::extractor::extract(std::forward(a0)), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -263,9 +263,9 @@ namespace boost { { return table_.emplace_unique( table::extractor::extract( - boost::forward(a0), boost::forward(a1)), + std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -274,9 +274,9 @@ namespace boost { { return table_.emplace_unique( table::extractor::extract( - boost::forward(a0), boost::forward(a1)), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } #endif @@ -287,8 +287,8 @@ namespace boost { iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args) { return table_.emplace_hint_unique(hint, - table::extractor::extract(boost::forward(args)...), - boost::forward(args)...); + table::extractor::extract(std::forward(args)...), + std::forward(args)...); } #else @@ -309,9 +309,9 @@ namespace boost { iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) { return table_.emplace_hint_unique(hint, - table::extractor::extract(boost::forward(a0)), + table::extractor::extract(std::forward(a0)), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -320,9 +320,9 @@ namespace boost { { return table_.emplace_hint_unique(hint, table::extractor::extract( - boost::forward(a0), boost::forward(a1)), + std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -331,9 +331,9 @@ namespace boost { { return table_.emplace_hint_unique(hint, table::extractor::extract( - boost::forward(a0), boost::forward(a1)), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } #endif @@ -347,7 +347,7 @@ namespace boost { { \ return table_.emplace_unique( \ table::extractor::extract( \ - boost::forward(a0), boost::forward(a1)), \ + std::forward(a0), std::forward(a1)), \ boost::unordered::detail::create_emplace_args( \ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } \ @@ -358,7 +358,7 @@ namespace boost { { \ return table_.emplace_hint_unique(hint, \ table::extractor::extract( \ - boost::forward(a0), boost::forward(a1)), \ + std::forward(a0), std::forward(a1)), \ boost::unordered::detail::create_emplace_args( \ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } @@ -392,7 +392,7 @@ namespace boost { std::pair >::type insert(BOOST_RV_REF(P2) obj) { - return this->emplace(boost::forward(obj)); + return this->emplace(std::forward(obj)); } iterator insert(const_iterator hint, value_type const& x) @@ -410,7 +410,7 @@ namespace boost { boost::is_constructible, iterator>::type insert(const_iterator hint, BOOST_RV_REF(P2) obj) { - return this->emplace_hint(hint, boost::forward(obj)); + return this->emplace_hint(hint, std::forward(obj)); } template void insert(InputIt, InputIt); @@ -436,7 +436,7 @@ namespace boost { node_type>::type extract(BOOST_FWD_REF(Key) k) { - return node_type(table_.extract_by_key_impl(boost::forward(k)), + return node_type(table_.extract_by_key_impl(std::forward(k)), table_.node_alloc()); } @@ -468,7 +468,7 @@ namespace boost { std::pair try_emplace( key_type const& k, BOOST_FWD_REF(Args)... args) { - return table_.try_emplace_unique(k, boost::forward(args)...); + return table_.try_emplace_unique(k, std::forward(args)...); } template @@ -476,7 +476,7 @@ namespace boost { BOOST_RV_REF(key_type) k, BOOST_FWD_REF(Args)... args) { return table_.try_emplace_unique( - std::move(k), boost::forward(args)...); + std::move(k), std::forward(args)...); } template @@ -486,7 +486,7 @@ namespace boost { try_emplace(Key&& k, Args&&... args) { return table_.try_emplace_unique( - boost::forward(k), boost::forward(args)...); + std::forward(k), std::forward(args)...); } template @@ -494,7 +494,7 @@ namespace boost { const_iterator hint, key_type const& k, BOOST_FWD_REF(Args)... args) { return table_.try_emplace_hint_unique( - hint, k, boost::forward(args)...); + hint, k, std::forward(args)...); } template @@ -502,7 +502,7 @@ namespace boost { BOOST_FWD_REF(Args)... args) { return table_.try_emplace_hint_unique( - hint, std::move(k), boost::forward(args)...); + hint, std::move(k), std::forward(args)...); } template @@ -512,7 +512,7 @@ namespace boost { try_emplace(const_iterator hint, Key&& k, Args&&... args) { return table_.try_emplace_hint_unique( - hint, boost::forward(k), boost::forward(args)...); + hint, std::forward(k), std::forward(args)...); } #else @@ -524,7 +524,7 @@ namespace boost { template std::pair try_emplace(BOOST_FWD_REF(Key) k) { - return table_.try_emplace_unique(boost::forward(k)); + return table_.try_emplace_unique(std::forward(k)); } // In order to make this a template, this handles both: @@ -534,7 +534,7 @@ namespace boost { template iterator try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k) { - return table_.try_emplace_hint_unique(hint, boost::forward(k)); + return table_.try_emplace_hint_unique(hint, std::forward(k)); } // try_emplace(key const&, Args&&...) @@ -545,7 +545,7 @@ namespace boost { { return table_.try_emplace_unique( k, boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -554,7 +554,7 @@ namespace boost { { return table_.try_emplace_unique( k, boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -562,8 +562,8 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.try_emplace_unique(k, - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } // try_emplace(key&&, Args&&...) @@ -574,7 +574,7 @@ namespace boost { { return table_.try_emplace_unique( std::move(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -583,7 +583,7 @@ namespace boost { { return table_.try_emplace_unique( std::move(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -591,8 +591,8 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.try_emplace_unique(std::move(k), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } // try_emplace(Key&&, Args&&...) @@ -604,8 +604,8 @@ namespace boost { try_emplace(BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0) { return table_.try_emplace_unique( - boost::forward(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(k), boost::unordered::detail::create_emplace_args( + std::forward(a0))); } template @@ -615,9 +615,9 @@ namespace boost { try_emplace( BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { - return table_.try_emplace_unique(boost::forward(k), + return table_.try_emplace_unique(std::forward(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -627,9 +627,9 @@ namespace boost { try_emplace(BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.try_emplace_unique(boost::forward(k), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + return table_.try_emplace_unique(std::forward(k), + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } // try_emplace(const_iterator hint, key const&, Args&&...) @@ -640,7 +640,7 @@ namespace boost { { return table_.try_emplace_hint_unique(hint, k, boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -649,7 +649,7 @@ namespace boost { { return table_.try_emplace_hint_unique(hint, k, boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -657,8 +657,8 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.try_emplace_hint_unique(hint, k, - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } // try_emplace(const_iterator hint, key&&, Args&&...) @@ -669,7 +669,7 @@ namespace boost { { return table_.try_emplace_hint_unique(hint, std::move(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -678,7 +678,7 @@ namespace boost { { return table_.try_emplace_hint_unique(hint, std::move(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -686,8 +686,8 @@ namespace boost { BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { return table_.try_emplace_hint_unique(hint, std::move(k), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } // try_emplace(const_iterator hint, Key&&, Args&&...) @@ -699,9 +699,9 @@ namespace boost { try_emplace( const_iterator hint, BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0) { - return table_.try_emplace_hint_unique(hint, boost::forward(k), + return table_.try_emplace_hint_unique(hint, std::forward(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -711,9 +711,9 @@ namespace boost { try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1) { - return table_.try_emplace_hint_unique(hint, boost::forward(k), + return table_.try_emplace_hint_unique(hint, std::forward(k), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -723,9 +723,9 @@ namespace boost { try_emplace(const_iterator hint, BOOST_FWD_REF(Key) k, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2) { - return table_.try_emplace_hint_unique(hint, boost::forward(k), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + return table_.try_emplace_hint_unique(hint, std::forward(k), + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } #define BOOST_UNORDERED_TRY_EMPLACE(z, n, _) \ @@ -783,7 +783,7 @@ namespace boost { std::pair insert_or_assign( key_type const& k, BOOST_FWD_REF(M) obj) { - return table_.insert_or_assign_unique(k, boost::forward(obj)); + return table_.insert_or_assign_unique(k, std::forward(obj)); } template @@ -791,7 +791,7 @@ namespace boost { BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj) { return table_.insert_or_assign_unique( - std::move(k), boost::forward(obj)); + std::move(k), std::forward(obj)); } template @@ -800,14 +800,14 @@ namespace boost { insert_or_assign(BOOST_FWD_REF(Key) k, BOOST_FWD_REF(M) obj) { return table_.insert_or_assign_unique( - boost::forward(k), boost::forward(obj)); + std::forward(k), std::forward(obj)); } template iterator insert_or_assign( const_iterator, key_type const& k, BOOST_FWD_REF(M) obj) { - return table_.insert_or_assign_unique(k, boost::forward(obj)).first; + return table_.insert_or_assign_unique(k, std::forward(obj)).first; } template @@ -815,7 +815,7 @@ namespace boost { const_iterator, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj) { return table_ - .insert_or_assign_unique(std::move(k), boost::forward(obj)) + .insert_or_assign_unique(std::move(k), std::forward(obj)) .first; } @@ -827,7 +827,7 @@ namespace boost { { return table_ .insert_or_assign_unique( - boost::forward(k), boost::forward(obj)) + std::forward(k), std::forward(obj)) .first; } @@ -842,7 +842,7 @@ namespace boost { size_type>::type erase(BOOST_FWD_REF(Key) k) { - return table_.erase_key_unique_impl(boost::forward(k)); + return table_.erase_key_unique_impl(std::forward(k)); } BOOST_UNORDERED_DEPRECATED("Use erase instead") @@ -1003,7 +1003,7 @@ namespace boost { size_type>::type bucket(BOOST_FWD_REF(Key) k) const { - return table_.hash_to_bucket(table_.hash(boost::forward(k))); + return table_.hash_to_bucket(table_.hash(std::forward(k))); } local_iterator begin(size_type n) { return table_.begin(n); } @@ -1308,7 +1308,7 @@ namespace boost { { return iterator(table_.emplace_equiv( boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::forward(args)...))); + table_.node_alloc(), std::forward(args)...))); } #else @@ -1333,7 +1333,7 @@ namespace boost { return iterator(table_.emplace_equiv( boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0))))); + std::forward(a0))))); } template @@ -1343,7 +1343,7 @@ namespace boost { boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))))); + std::forward(a0), std::forward(a1))))); } template @@ -1354,8 +1354,8 @@ namespace boost { boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1), - boost::forward(a2))))); + std::forward(a0), std::forward(a1), + std::forward(a2))))); } #endif @@ -1367,7 +1367,7 @@ namespace boost { { return iterator(table_.emplace_hint_equiv( hint, boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::forward(args)...))); + table_.node_alloc(), std::forward(args)...))); } #else @@ -1390,7 +1390,7 @@ namespace boost { return iterator(table_.emplace_hint_equiv(hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0))))); + std::forward(a0))))); } template @@ -1401,7 +1401,7 @@ namespace boost { hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))))); + std::forward(a0), std::forward(a1))))); } template @@ -1412,8 +1412,8 @@ namespace boost { hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1), - boost::forward(a2))))); + std::forward(a0), std::forward(a1), + std::forward(a2))))); } #endif @@ -1467,7 +1467,7 @@ namespace boost { boost::is_constructible, iterator>::type insert(BOOST_RV_REF(P2) obj) { - return this->emplace(boost::forward(obj)); + return this->emplace(std::forward(obj)); } iterator insert(const_iterator hint, value_type const& x) @@ -1485,7 +1485,7 @@ namespace boost { boost::is_constructible, iterator>::type insert(const_iterator hint, BOOST_RV_REF(P2) obj) { - return this->emplace_hint(hint, boost::forward(obj)); + return this->emplace_hint(hint, std::forward(obj)); } template void insert(InputIt, InputIt); @@ -1545,7 +1545,7 @@ namespace boost { size_type>::type erase(BOOST_FWD_REF(Key) k) { - return table_.erase_key_equiv_impl(boost::forward(k)); + return table_.erase_key_equiv_impl(std::forward(k)); } BOOST_UNORDERED_DEPRECATED("Use erase instead") @@ -1678,7 +1678,7 @@ namespace boost { size_type>::type bucket(BOOST_FWD_REF(Key) k) const { - return table_.hash_to_bucket(table_.hash(boost::forward(k))); + return table_.hash_to_bucket(table_.hash(std::forward(k))); } local_iterator begin(size_type n) @@ -2194,7 +2194,7 @@ namespace boost { typename unordered_map::mapped_type&>::type unordered_map::operator[](BOOST_FWD_REF(Key) k) { - return table_.try_emplace_unique(boost::forward(k)).first->second; + return table_.try_emplace_unique(std::forward(k)).first->second; } template @@ -2238,7 +2238,7 @@ namespace boost { typedef typename table::node_pointer node_pointer; if (table_.size_) { - node_pointer p = table_.find_node(boost::forward(k)); + node_pointer p = table_.find_node(std::forward(k)); if (p) return p->value().second; } @@ -2256,7 +2256,7 @@ namespace boost { typedef typename table::node_pointer node_pointer; if (table_.size_) { - node_pointer p = table_.find_node(boost::forward(k)); + node_pointer p = table_.find_node(std::forward(k)); if (p) return p->value().second; } diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index f7ec58f7..67d416ce 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -224,8 +224,8 @@ namespace boost { std::pair emplace(BOOST_FWD_REF(Args)... args) { return table_.emplace_unique( - table::extractor::extract(boost::forward(args)...), - boost::forward(args)...); + table::extractor::extract(std::forward(args)...), + std::forward(args)...); } #else @@ -250,9 +250,9 @@ namespace boost { std::pair emplace(BOOST_FWD_REF(A0) a0) { return table_.emplace_unique( - table::extractor::extract(boost::forward(a0)), + table::extractor::extract(std::forward(a0)), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -261,9 +261,9 @@ namespace boost { { return table_.emplace_unique( table::extractor::extract( - boost::forward(a0), boost::forward(a1)), + std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -272,9 +272,9 @@ namespace boost { { return table_.emplace_unique( table::extractor::extract( - boost::forward(a0), boost::forward(a1)), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } #endif @@ -285,8 +285,8 @@ namespace boost { iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args) { return table_.emplace_hint_unique(hint, - table::extractor::extract(boost::forward(args)...), - boost::forward(args)...); + table::extractor::extract(std::forward(args)...), + std::forward(args)...); } #else @@ -307,9 +307,9 @@ namespace boost { iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0) { return table_.emplace_hint_unique(hint, - table::extractor::extract(boost::forward(a0)), + table::extractor::extract(std::forward(a0)), boost::unordered::detail::create_emplace_args( - boost::forward(a0))); + std::forward(a0))); } template @@ -318,9 +318,9 @@ namespace boost { { return table_.emplace_hint_unique(hint, table::extractor::extract( - boost::forward(a0), boost::forward(a1)), + std::forward(a0), std::forward(a1)), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))); + std::forward(a0), std::forward(a1))); } template @@ -329,9 +329,9 @@ namespace boost { { return table_.emplace_hint_unique(hint, table::extractor::extract( - boost::forward(a0), boost::forward(a1)), - boost::unordered::detail::create_emplace_args(boost::forward(a0), - boost::forward(a1), boost::forward(a2))); + std::forward(a0), std::forward(a1)), + boost::unordered::detail::create_emplace_args(std::forward(a0), + std::forward(a1), std::forward(a2))); } #endif @@ -345,7 +345,7 @@ namespace boost { { \ return table_.emplace_unique( \ table::extractor::extract( \ - boost::forward(a0), boost::forward(a1)), \ + std::forward(a0), std::forward(a1)), \ boost::unordered::detail::create_emplace_args( \ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } \ @@ -356,7 +356,7 @@ namespace boost { { \ return table_.emplace_hint_unique(hint, \ table::extractor::extract( \ - boost::forward(a0), boost::forward(a1)), \ + std::forward(a0), std::forward(a1)), \ boost::unordered::detail::create_emplace_args( \ BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \ } @@ -390,7 +390,7 @@ namespace boost { std::pair >::type insert(BOOST_FWD_REF(Key) k) { - return table_.try_emplace_unique(boost::forward(k)); + return table_.try_emplace_unique(std::forward(k)); } iterator insert(const_iterator hint, value_type const& x) @@ -409,7 +409,7 @@ namespace boost { iterator>::type insert(const_iterator hint, BOOST_FWD_REF(Key) k) { - return table_.try_emplace_hint_unique(hint, boost::forward(k)); + return table_.try_emplace_hint_unique(hint, std::forward(k)); } template void insert(InputIt, InputIt); @@ -470,7 +470,7 @@ namespace boost { size_type>::type erase(BOOST_FWD_REF(Key) k) { - return table_.erase_key_unique_impl(boost::forward(k)); + return table_.erase_key_unique_impl(std::forward(k)); } BOOST_UNORDERED_DEPRECATED("Use erase instead") @@ -583,7 +583,7 @@ namespace boost { size_type>::type bucket(BOOST_FWD_REF(Key) k) const { - return table_.hash_to_bucket(table_.hash(boost::forward(k))); + return table_.hash_to_bucket(table_.hash(std::forward(k))); } local_iterator begin(size_type n) @@ -879,7 +879,7 @@ namespace boost { { return iterator(table_.emplace_equiv( boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::forward(args)...))); + table_.node_alloc(), std::forward(args)...))); } #else @@ -904,7 +904,7 @@ namespace boost { return iterator(table_.emplace_equiv( boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0))))); + std::forward(a0))))); } template @@ -914,7 +914,7 @@ namespace boost { boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))))); + std::forward(a0), std::forward(a1))))); } template @@ -925,8 +925,8 @@ namespace boost { boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1), - boost::forward(a2))))); + std::forward(a0), std::forward(a1), + std::forward(a2))))); } #endif @@ -938,7 +938,7 @@ namespace boost { { return iterator(table_.emplace_hint_equiv( hint, boost::unordered::detail::func::construct_node_from_args( - table_.node_alloc(), boost::forward(args)...))); + table_.node_alloc(), std::forward(args)...))); } #else @@ -961,7 +961,7 @@ namespace boost { return iterator(table_.emplace_hint_equiv(hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0))))); + std::forward(a0))))); } template @@ -972,7 +972,7 @@ namespace boost { hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1))))); + std::forward(a0), std::forward(a1))))); } template @@ -983,8 +983,8 @@ namespace boost { hint, boost::unordered::detail::func::construct_node_from_args( table_.node_alloc(), boost::unordered::detail::create_emplace_args( - boost::forward(a0), boost::forward(a1), - boost::forward(a2))))); + std::forward(a0), std::forward(a1), + std::forward(a2))))); } #endif @@ -1208,7 +1208,7 @@ namespace boost { size_type>::type bucket(BOOST_FWD_REF(Key) k) const { - return table_.hash_to_bucket(table_.hash(boost::forward(k))); + return table_.hash_to_bucket(table_.hash(std::forward(k))); } local_iterator begin(size_type n) diff --git a/test/objects/cxx11_allocator.hpp b/test/objects/cxx11_allocator.hpp index 9e5749ce..922e908c 100644 --- a/test/objects/cxx11_allocator.hpp +++ b/test/objects/cxx11_allocator.hpp @@ -226,7 +226,7 @@ namespace test void construct(U* p, BOOST_FWD_REF(Args)... args) { detail::tracker.track_construct((void*)p, sizeof(U), tag_); - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } #endif diff --git a/test/objects/exception.hpp b/test/objects/exception.hpp index e4639ae4..f2b2c1d0 100644 --- a/test/objects/exception.hpp +++ b/test/objects/exception.hpp @@ -518,7 +518,7 @@ namespace test { UNORDERED_SCOPE(allocator::construct(U*, BOOST_FWD_REF(Args)...)) { UNORDERED_EPOINT("Mock allocator construct function.") - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } test::detail::tracker.track_construct((void*)p, sizeof(U), tag_); } @@ -700,7 +700,7 @@ namespace test { UNORDERED_SCOPE(allocator2::construct(U*, BOOST_FWD_REF(Args)...)) { UNORDERED_EPOINT("Mock allocator2 construct function.") - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } test::detail::tracker.track_construct((void*)p, sizeof(U), tag_); } diff --git a/test/objects/minimal.hpp b/test/objects/minimal.hpp index bf94d924..600621d8 100644 --- a/test/objects/minimal.hpp +++ b/test/objects/minimal.hpp @@ -470,7 +470,7 @@ namespace test { template void construct(U* p, BOOST_FWD_REF(Args)... args) { - new ((void*)p) U(boost::forward(args)...); + new ((void*)p) U(std::forward(args)...); } #endif @@ -544,7 +544,7 @@ namespace test { template void construct(U* p, BOOST_FWD_REF(Args)... args) { - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } #endif @@ -622,7 +622,7 @@ namespace test { template void construct(U* p, BOOST_FWD_REF(Args)... args) { - new ((void*)p) U(boost::forward(args)...); + new ((void*)p) U(std::forward(args)...); } #endif diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 97914909..0ee91371 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -413,7 +413,7 @@ namespace test { template void construct(U* p, Args&&... args) { detail::tracker.track_construct((void*)p, sizeof(U), tag_); - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } template void destroy(U* p) @@ -668,7 +668,7 @@ namespace test { void construct(U* p, BOOST_FWD_REF(Args)... args) { detail::tracker.track_construct((void*)p, sizeof(U), tag_); - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } #endif diff --git a/test/unordered/scary_tests.cpp b/test/unordered/scary_tests.cpp index 7049424e..2111b700 100644 --- a/test/unordered/scary_tests.cpp +++ b/test/unordered/scary_tests.cpp @@ -93,7 +93,7 @@ public: template void construct(U* p, BOOST_FWD_REF(Args)... args) { - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } #endif @@ -177,7 +177,7 @@ public: template void construct(U* p, BOOST_FWD_REF(Args)... args) { - new (p) U(boost::forward(args)...); + new (p) U(std::forward(args)...); } #endif