diff --git a/include/boost/unordered/concurrent_flat_map.hpp b/include/boost/unordered/concurrent_flat_map.hpp index a06ec31f..8fb5ec2e 100644 --- a/include/boost/unordered/concurrent_flat_map.hpp +++ b/include/boost/unordered/concurrent_flat_map.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include @@ -65,9 +64,9 @@ namespace boost { using init_type = typename type_policy::init_type; using size_type = std::size_t; using difference_type = std::ptrdiff_t; - using hasher = typename boost::type_identity::type; - using key_equal = typename boost::type_identity::type; - using allocator_type = typename boost::type_identity::type; + using hasher = typename boost::unordered::detail::type_identity::type; + using key_equal = typename boost::unordered::detail::type_identity::type; + using allocator_type = typename boost::unordered::detail::type_identity::type; using reference = value_type&; using const_reference = value_type const&; using pointer = typename boost::allocator_pointer::type; @@ -757,8 +756,8 @@ namespace boost { Allocator>; template >, - class Pred = std::equal_to >, + class Hash = boost::hash >, + class Pred = std::equal_to >, class Allocator = std::allocator >, class = boost::enable_if_t >, class = boost::enable_if_t >, @@ -766,7 +765,7 @@ namespace boost { concurrent_flat_map(std::initializer_list >, std::size_t = boost::unordered::detail::foa::default_bucket_count, Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> concurrent_flat_map, T, Hash, Pred, + -> concurrent_flat_map, T, Hash, Pred, Allocator>; template > > concurrent_flat_map(std::initializer_list >, std::size_t, - Allocator) -> concurrent_flat_map, T, - boost::hash >, - std::equal_to >, Allocator>; + Allocator) -> concurrent_flat_map, T, + boost::hash >, + std::equal_to >, Allocator>; template > > concurrent_flat_map(std::initializer_list >, Allocator) - -> concurrent_flat_map, T, - boost::hash >, - std::equal_to >, Allocator>; + -> concurrent_flat_map, T, + boost::hash >, + std::equal_to >, Allocator>; template >, class = boost::enable_if_t > > concurrent_flat_map(std::initializer_list >, std::size_t, - Hash, Allocator) -> concurrent_flat_map, T, - Hash, std::equal_to >, Allocator>; + Hash, Allocator) -> concurrent_flat_map, T, + Hash, std::equal_to >, Allocator>; #endif diff --git a/include/boost/unordered/concurrent_flat_set.hpp b/include/boost/unordered/concurrent_flat_set.hpp index 96ddd98b..fea086be 100644 --- a/include/boost/unordered/concurrent_flat_set.hpp +++ b/include/boost/unordered/concurrent_flat_set.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include @@ -60,9 +59,9 @@ namespace boost { using init_type = typename type_policy::init_type; using size_type = std::size_t; using difference_type = std::ptrdiff_t; - using hasher = typename boost::type_identity::type; - using key_equal = typename boost::type_identity::type; - using allocator_type = typename boost::type_identity::type; + using hasher = typename boost::unordered::detail::type_identity::type; + using key_equal = typename boost::unordered::detail::type_identity::type; + using allocator_type = typename boost::unordered::detail::type_identity::type; using reference = value_type&; using const_reference = value_type const&; using pointer = typename boost::allocator_pointer::type; diff --git a/include/boost/unordered/detail/archive_constructed.hpp b/include/boost/unordered/detail/archive_constructed.hpp index 8d01d5d4..2aa58404 100644 --- a/include/boost/unordered/detail/archive_constructed.hpp +++ b/include/boost/unordered/detail/archive_constructed.hpp @@ -9,13 +9,13 @@ #ifndef BOOST_UNORDERED_DETAIL_ARCHIVE_CONSTRUCTED_HPP #define BOOST_UNORDERED_DETAIL_ARCHIVE_CONSTRUCTED_HPP +#include + #include #include #include #include #include -#include -#include namespace boost{ namespace unordered{ @@ -54,7 +54,7 @@ struct archive_constructed:private noncopyable #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif - T& get(){return *reinterpret_cast(&space);} + T& get(){return *space.address();} #if defined(BOOST_UNORDERED_IGNORE_WSTRICT_ALIASING) #pragma GCC diagnostic pop @@ -62,7 +62,7 @@ struct archive_constructed:private noncopyable #endif private: - typename aligned_storage::value>::type space; + opt_storage space; }; } /* namespace detail */ diff --git a/include/boost/unordered/detail/fca.hpp b/include/boost/unordered/detail/fca.hpp index 5af0e9a6..a340671e 100644 --- a/include/boost/unordered/detail/fca.hpp +++ b/include/boost/unordered/detail/fca.hpp @@ -115,6 +115,7 @@ to normal separate chaining implementations. #include #include +#include #include #include @@ -125,8 +126,6 @@ to normal separate chaining implementations. #include #include #include -#include -#include #include @@ -143,19 +142,18 @@ namespace boost { node>::type node_pointer; node_pointer next; - typename boost::aligned_storage::value>::type buf; + opt_storage buf; node() noexcept : next(), buf() {} value_type* value_ptr() noexcept { - return reinterpret_cast(buf.address()); + return buf.address(); } value_type& value() noexcept { - return *reinterpret_cast(buf.address()); + return *buf.address(); } }; diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index 2ac22bff..02869a59 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -22,13 +22,10 @@ #include #include #include -#include -#include -#include -#include #include #include #include +#include #include #include #include @@ -133,10 +130,10 @@ #define BOOST_UNORDERED_THREAD_SANITIZER #endif -#define BOOST_UNORDERED_STATIC_ASSERT_HASH_PRED(Hash, Pred) \ - static_assert(boost::is_nothrow_swappable::value, \ - "Template parameter Hash is required to be nothrow Swappable."); \ - static_assert(boost::is_nothrow_swappable::value, \ +#define BOOST_UNORDERED_STATIC_ASSERT_HASH_PRED(Hash, Pred) \ + static_assert(boost::unordered::detail::is_nothrow_swappable::value, \ + "Template parameter Hash is required to be nothrow Swappable."); \ + static_assert(boost::unordered::detail::is_nothrow_swappable::value, \ "Template parameter Pred is required to be nothrow Swappable"); namespace boost{ @@ -1054,13 +1051,7 @@ struct table_arrays initialize_groups( arrays.groups(),groups_size, std::integral_constant< - bool, -#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) - /* std::is_trivially_constructible not provided */ - boost::has_trivial_constructor::value -#else - std::is_trivially_constructible::value -#endif + bool,std::is_trivially_constructible::value >{}); arrays.groups()[groups_size-1].set_sentinel(); } diff --git a/include/boost/unordered/detail/foa/node_handle.hpp b/include/boost/unordered/detail/foa/node_handle.hpp index ddf34414..ae1600d8 100644 --- a/include/boost/unordered/detail/foa/node_handle.hpp +++ b/include/boost/unordered/detail/foa/node_handle.hpp @@ -9,6 +9,8 @@ #ifndef BOOST_UNORDERED_DETAIL_FOA_NODE_HANDLE_HPP #define BOOST_UNORDERED_DETAIL_FOA_NODE_HANDLE_HPP +#include + #include #include @@ -25,14 +27,6 @@ struct insert_return_type NodeType node; }; -template -union opt_storage { - BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS T t_; - - opt_storage(){} - ~opt_storage(){} -}; - template struct node_handle_base { diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index be12dff1..f3629a2b 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -31,20 +32,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include @@ -124,7 +111,7 @@ namespace boost { // iterator SFINAE template - struct is_forward : boost::is_base_of::iterator_category> { }; @@ -292,8 +279,7 @@ namespace boost { ////////////////////////////////////////////////////////////////////////// // Bits and pieces for implementing traits - template - typename boost::add_lvalue_reference::type make(); + template typename std::add_lvalue_reference::type make(); struct choice9 { typedef char (&type)[9]; @@ -385,8 +371,7 @@ namespace boost { { typedef ValueType value_type; - typename boost::aligned_storage::value>::type data_; + opt_storage data_; value_base() : data_() {} @@ -865,26 +850,23 @@ namespace boost { { public: static const bool nothrow_move_assignable = - boost::is_nothrow_move_assignable::value && - boost::is_nothrow_move_assignable

::value; + std::is_nothrow_move_assignable::value && + std::is_nothrow_move_assignable

::value; static const bool nothrow_move_constructible = - boost::is_nothrow_move_constructible::value && - boost::is_nothrow_move_constructible

::value; + std::is_nothrow_move_constructible::value && + std::is_nothrow_move_constructible

::value; static const bool nothrow_swappable = - boost::is_nothrow_swappable::value && - boost::is_nothrow_swappable

::value; + boost::unordered::detail::is_nothrow_swappable::value && + boost::unordered::detail::is_nothrow_swappable

::value; private: functions& operator=(functions const&); typedef compressed function_pair; - typedef typename boost::aligned_storage::value>::type aligned_function; - unsigned char current_; // 0/1 - Currently active functions // +2 - Both constructed - aligned_function funcs_[2]; + opt_storage funcs_[2]; public: functions(H const& hf, P const& eq) : current_(0) @@ -2138,8 +2120,8 @@ namespace boost { void merge_unique(boost::unordered::detail::table& other) { typedef boost::unordered::detail::table other_table; - BOOST_UNORDERED_STATIC_ASSERT(( - boost::is_same::value)); + BOOST_UNORDERED_STATIC_ASSERT( + (std::is_same::value)); BOOST_ASSERT(this->node_alloc() == other.node_alloc()); if (other.size_ == 0) { @@ -2816,8 +2798,7 @@ namespace boost { sizeof(choice2::type) }; - typedef - typename boost::conditional::type type; + typedef typename std::conditional::type type; }; template struct set_extractor @@ -2846,7 +2827,7 @@ namespace boost { template struct map_extractor { typedef ValueType value_type; - typedef typename boost::remove_const::first_type>::type key_type; static key_type const& extract(value_type const& v) { return v.first; } diff --git a/include/boost/unordered/detail/narrow_cast.hpp b/include/boost/unordered/detail/narrow_cast.hpp index 523f6e4a..3e59cdd0 100644 --- a/include/boost/unordered/detail/narrow_cast.hpp +++ b/include/boost/unordered/detail/narrow_cast.hpp @@ -12,8 +12,7 @@ #include #include -#include -#include +#include namespace boost{ namespace unordered{ @@ -22,8 +21,8 @@ namespace detail{ template constexpr To narrow_cast(From x) noexcept { - BOOST_UNORDERED_STATIC_ASSERT(boost::is_integral::value); - BOOST_UNORDERED_STATIC_ASSERT(boost::is_integral::value); + BOOST_UNORDERED_STATIC_ASSERT(std::is_integral::value); + BOOST_UNORDERED_STATIC_ASSERT(std::is_integral::value); BOOST_UNORDERED_STATIC_ASSERT(sizeof(From)>=sizeof(To)); return static_cast( @@ -33,7 +32,7 @@ constexpr To narrow_cast(From x) noexcept /* Avoids VS's "Run-Time Check Failure #1 - A cast to a smaller data type * has caused a loss of data." */ - &static_cast::type>(~static_cast(0)) + &static_cast::type>(~static_cast(0)) #endif ); } diff --git a/include/boost/unordered/detail/opt_storage.hpp b/include/boost/unordered/detail/opt_storage.hpp new file mode 100644 index 00000000..73f88fef --- /dev/null +++ b/include/boost/unordered/detail/opt_storage.hpp @@ -0,0 +1,24 @@ +#ifndef BOOST_UNORDERED_DETAIL_OPT_STORAGE_HPP +#define BOOST_UNORDERED_DETAIL_OPT_STORAGE_HPP + +#include +#include + +namespace boost { + namespace unordered { + namespace detail { + template union opt_storage + { + BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS T t_; + + opt_storage() {} + ~opt_storage() {} + + T* address() noexcept { return boost::addressof(t_); } + T const* address() const noexcept { return boost::addressof(t_); } + }; + } // namespace detail + } // namespace unordered +} // namespace boost + +#endif // BOOST_UNORDERED_DETAIL_OPT_STORAGE_HPP \ No newline at end of file diff --git a/include/boost/unordered/detail/serialize_container.hpp b/include/boost/unordered/detail/serialize_container.hpp index b1772ebe..1c037e2b 100644 --- a/include/boost/unordered/detail/serialize_container.hpp +++ b/include/boost/unordered/detail/serialize_container.hpp @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include #include @@ -109,9 +107,9 @@ template struct load_or_save_unordered_map /* save */ template void operator()(Archive& ar,const Map& x,unsigned int)const { - typedef typename boost::remove_const< + typedef typename std::remove_const< typename Map::key_type>::type key_type; - typedef typename boost::remove_const< + typedef typename std::remove_const< typename Map::mapped_type>::type mapped_type; typedef typename Map::const_iterator const_iterator; @@ -146,9 +144,9 @@ template struct load_or_save_unordered_map /* load */ template void operator()(Archive& ar,Map& x,unsigned int)const { - typedef typename boost::remove_const< + typedef typename std::remove_const< typename Map::key_type>::type key_type; - typedef typename boost::remove_const< + typedef typename std::remove_const< typename Map::mapped_type>::type mapped_type; typedef typename Map::iterator iterator; @@ -195,7 +193,7 @@ void serialize_container(Archive& ar,Container& x,unsigned int version) { load_or_save_container< Container, - boost::is_same< + std::is_same< typename Container::key_type,typename Container::value_type>::value, Archive::is_saving::value>()(ar,x,version); } diff --git a/include/boost/unordered/detail/serialize_tracked_address.hpp b/include/boost/unordered/detail/serialize_tracked_address.hpp index 6d7d08ab..36faaa94 100644 --- a/include/boost/unordered/detail/serialize_tracked_address.hpp +++ b/include/boost/unordered/detail/serialize_tracked_address.hpp @@ -9,12 +9,13 @@ #ifndef BOOST_UNORDERED_DETAIL_SERIALIZE_TRACKED_ADDRESS_HPP #define BOOST_UNORDERED_DETAIL_SERIALIZE_TRACKED_ADDRESS_HPP +#include + #include #include #include -#include -#include -#include + +#include namespace boost{ namespace unordered{ @@ -44,7 +45,7 @@ template void track_address(Archive& ar,Ptr p) { typedef typename boost::pointer_traits ptr_traits; - typedef typename boost::remove_const< + typedef typename std::remove_const< typename ptr_traits::element_type>::type element_type; if(p){ @@ -57,10 +58,10 @@ void track_address(Archive& ar,Ptr p) } template -void serialize_tracked_address(Archive& ar,Ptr& p,boost::true_type /* save */) +void serialize_tracked_address(Archive& ar,Ptr& p,std::true_type /* save */) { typedef typename boost::pointer_traits ptr_traits; - typedef typename boost::remove_const< + typedef typename std::remove_const< typename ptr_traits::element_type>::type element_type; typedef serialization_tracker tracker; @@ -73,10 +74,10 @@ void serialize_tracked_address(Archive& ar,Ptr& p,boost::true_type /* save */) } template -void serialize_tracked_address(Archive& ar,Ptr& p,boost::false_type /* load */) +void serialize_tracked_address(Archive& ar,Ptr& p,std::false_type /* load */) { typedef typename boost::pointer_traits ptr_traits; - typedef typename boost::remove_const< + typedef typename std::remove_const< typename ptr_traits::element_type>::type element_type; typedef serialization_tracker tracker; @@ -93,7 +94,7 @@ void serialize_tracked_address(Archive& ar,Ptr& p) { serialize_tracked_address( ar,p, - boost::integral_constant()); + std::integral_constant()); } } /* namespace detail */ diff --git a/include/boost/unordered/detail/type_traits.hpp b/include/boost/unordered/detail/type_traits.hpp index 838611ce..b6ae8506 100644 --- a/include/boost/unordered/detail/type_traits.hpp +++ b/include/boost/unordered/detail/type_traits.hpp @@ -11,20 +11,13 @@ #pragma once #endif -#include -#include -#include -#include - #if !defined(BOOST_NO_CXX17_DEDUCTION_GUIDES) -#include -#include -#include - #include -#include #endif +#include +#include + // BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES #if !defined(BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES) @@ -40,19 +33,56 @@ namespace boost { namespace unordered { namespace detail { + + template struct type_identity + { + using type = T; + }; + + template struct make_void + { + typedef void type; + }; + + template using void_t = typename make_void::type; + + namespace type_traits_detail { + using std::swap; + + template struct is_nothrow_swappable_helper + { + constexpr static bool const value = false; + }; + + template + struct is_nothrow_swappable_helper(), std::declval()))> > + { + constexpr static bool const value = + noexcept(swap(std::declval(), std::declval())); + }; + + } // namespace type_traits_detail + + template struct is_nothrow_swappable + { + constexpr static bool const value = + type_traits_detail::is_nothrow_swappable_helper::value; + }; + //////////////////////////////////////////////////////////////////////////// // Type checkers used for the transparent member functions added by C++20 // and up template - struct is_transparent : public boost::false_type + struct is_transparent : public std::false_type { }; template struct is_transparent::type> - : public boost::true_type + typename boost::unordered::detail::make_void::type> + : public std::true_type { }; @@ -71,8 +101,8 @@ namespace boost { static bool const value = are_transparent::value && - !boost::is_convertible::value && - !boost::is_convertible::value; + !std::is_convertible::value && + !std::is_convertible::value; }; #if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES @@ -81,7 +111,7 @@ namespace boost { template constexpr bool const is_input_iterator_v = - !boost::is_integral::value; + !std::is_integral::value; template struct is_allocator { @@ -90,7 +120,7 @@ namespace boost { template struct is_allocator().allocate(std::size_t{}))> > { constexpr static bool const value = true; @@ -101,7 +131,7 @@ namespace boost { template constexpr bool const is_hash_v = - !boost::is_integral::value && !is_allocator_v; + !std::is_integral::value && !is_allocator_v; template constexpr bool const is_pred_v = !is_allocator_v

; @@ -116,7 +146,7 @@ namespace boost { typename std::pair const, iter_val_t >; #endif } // namespace detail - } // namespace unordered + } // namespace unordered } // namespace boost #endif // BOOST_UNORDERED_DETAIL_TYPE_TRAITS_HPP diff --git a/include/boost/unordered/hash_traits.hpp b/include/boost/unordered/hash_traits.hpp index dfc2716f..eeb21ba0 100644 --- a/include/boost/unordered/hash_traits.hpp +++ b/include/boost/unordered/hash_traits.hpp @@ -11,8 +11,7 @@ #ifndef BOOST_UNORDERED_HASH_TRAITS_HPP #define BOOST_UNORDERED_HASH_TRAITS_HPP -#include -#include +#include namespace boost{ namespace unordered{ @@ -20,12 +19,12 @@ namespace unordered{ namespace detail{ template -struct hash_is_avalanching_impl: boost::false_type{}; +struct hash_is_avalanching_impl: std::false_type{}; template struct hash_is_avalanching_impl::type>: - boost::true_type{}; + typename boost::unordered::detail::make_void::type>: + std::true_type{}; } /* namespace detail */ diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index b7ea0a82..37cf6d8c 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -65,9 +65,9 @@ namespace boost { using init_type = typename map_types::init_type; using size_type = std::size_t; using difference_type = std::ptrdiff_t; - using hasher = typename boost::type_identity::type; - using key_equal = typename boost::type_identity::type; - using allocator_type = typename boost::type_identity::type; + using hasher = typename boost::unordered::detail::type_identity::type; + using key_equal = typename boost::unordered::detail::type_identity::type; + using allocator_type = typename boost::unordered::detail::type_identity::type; using reference = value_type&; using const_reference = value_type const&; using pointer = typename boost::allocator_pointer::type; @@ -729,8 +729,8 @@ namespace boost { Allocator>; template >, - class Pred = std::equal_to >, + class Hash = boost::hash >, + class Pred = std::equal_to >, class Allocator = std::allocator >, class = boost::enable_if_t >, class = boost::enable_if_t >, @@ -738,7 +738,7 @@ namespace boost { unordered_flat_map(std::initializer_list >, std::size_t = boost::unordered::detail::foa::default_bucket_count, Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_flat_map, T, Hash, Pred, + -> unordered_flat_map, T, Hash, Pred, Allocator>; template > > unordered_flat_map(std::initializer_list >, std::size_t, - Allocator) -> unordered_flat_map, T, - boost::hash >, - std::equal_to >, Allocator>; + Allocator) -> unordered_flat_map, T, + boost::hash >, + std::equal_to >, Allocator>; template > > unordered_flat_map(std::initializer_list >, Allocator) - -> unordered_flat_map, T, - boost::hash >, - std::equal_to >, Allocator>; + -> unordered_flat_map, T, + boost::hash >, + std::equal_to >, Allocator>; template >, class = boost::enable_if_t > > unordered_flat_map(std::initializer_list >, std::size_t, - Hash, Allocator) -> unordered_flat_map, T, - Hash, std::equal_to >, Allocator>; + Hash, Allocator) -> unordered_flat_map, T, + Hash, std::equal_to >, Allocator>; #endif } // namespace unordered diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index a58c3bf8..c59ce96d 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -21,7 +21,6 @@ #include #include -#include #include @@ -47,9 +46,11 @@ namespace boost { typedef K key_type; typedef T mapped_type; typedef std::pair value_type; - typedef typename boost::type_identity::type hasher; - typedef typename boost::type_identity

::type key_equal; - typedef typename boost::type_identity::type allocator_type; + typedef typename boost::unordered::detail::type_identity::type hasher; + typedef + typename boost::unordered::detail::type_identity

::type key_equal; + typedef typename boost::unordered::detail::type_identity::type + allocator_type; private: typedef boost::unordered::detail::map types; @@ -147,8 +148,8 @@ namespace boost { unordered_map& operator=(unordered_map&& x) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_move_assignable::value&& - boost::is_nothrow_move_assignable

::value) + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_assignable

::value) { table_.move_assign(x.table_, std::true_type()); return *this; @@ -220,7 +221,7 @@ namespace boost { } template - typename boost::enable_if, + typename boost::enable_if, std::pair >::type insert(P2&& obj) { @@ -238,7 +239,7 @@ namespace boost { } template - typename boost::enable_if, + typename boost::enable_if, iterator>::type insert(const_iterator hint, P2&& obj) { @@ -399,8 +400,8 @@ namespace boost { void swap(unordered_map&) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value); + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value); void clear() noexcept { table_.clear_impl(); } template @@ -618,8 +619,8 @@ namespace boost { Allocator>; template >, - class Pred = std::equal_to >, + class Hash = boost::hash >, + class Pred = std::equal_to >, class Allocator = std::allocator >, class = boost::enable_if_t >, class = boost::enable_if_t >, @@ -627,7 +628,7 @@ namespace boost { unordered_map(std::initializer_list >, std::size_t = boost::unordered::detail::default_bucket_count, Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_map, T, Hash, Pred, Allocator>; + -> unordered_map, T, Hash, Pred, Allocator>; template >, @@ -662,23 +663,23 @@ namespace boost { template > > unordered_map(std::initializer_list >, std::size_t, - Allocator) -> unordered_map, T, - boost::hash >, - std::equal_to >, Allocator>; + Allocator) -> unordered_map, T, + boost::hash >, + std::equal_to >, Allocator>; template > > unordered_map(std::initializer_list >, Allocator) - -> unordered_map, T, - boost::hash >, - std::equal_to >, Allocator>; + -> unordered_map, T, + boost::hash >, + std::equal_to >, Allocator>; template >, class = boost::enable_if_t > > unordered_map(std::initializer_list >, std::size_t, Hash, - Allocator) -> unordered_map, T, Hash, - std::equal_to >, Allocator>; + Allocator) -> unordered_map, T, Hash, + std::equal_to >, Allocator>; #endif @@ -692,9 +693,11 @@ namespace boost { typedef K key_type; typedef T mapped_type; typedef std::pair value_type; - typedef typename boost::type_identity::type hasher; - typedef typename boost::type_identity

::type key_equal; - typedef typename boost::type_identity::type allocator_type; + typedef typename boost::unordered::detail::type_identity::type hasher; + typedef + typename boost::unordered::detail::type_identity

::type key_equal; + typedef typename boost::unordered::detail::type_identity::type + allocator_type; private: typedef boost::unordered::detail::map types; @@ -793,8 +796,8 @@ namespace boost { unordered_multimap& operator=(unordered_multimap&& x) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_move_assignable::value&& - boost::is_nothrow_move_assignable

::value) + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_assignable

::value) { table_.move_assign(x.table_, std::false_type()); return *this; @@ -860,7 +863,7 @@ namespace boost { iterator insert(value_type&& x) { return this->emplace(std::move(x)); } template - typename boost::enable_if, + typename boost::enable_if, iterator>::type insert(P2&& obj) { @@ -878,7 +881,7 @@ namespace boost { } template - typename boost::enable_if, + typename boost::enable_if, iterator>::type insert(const_iterator hint, P2&& obj) { @@ -942,8 +945,8 @@ namespace boost { void swap(unordered_multimap&) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value); + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value); void clear() noexcept { table_.clear_impl(); } template @@ -1135,8 +1138,8 @@ namespace boost { Allocator>; template >, - class Pred = std::equal_to >, + class Hash = boost::hash >, + class Pred = std::equal_to >, class Allocator = std::allocator >, class = boost::enable_if_t >, class = boost::enable_if_t >, @@ -1144,8 +1147,7 @@ namespace boost { unordered_multimap(std::initializer_list >, std::size_t = boost::unordered::detail::default_bucket_count, Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_multimap, T, Hash, Pred, - Allocator>; + -> unordered_multimap, T, Hash, Pred, Allocator>; template >, @@ -1181,23 +1183,23 @@ namespace boost { template > > unordered_multimap(std::initializer_list >, std::size_t, - Allocator) -> unordered_multimap, T, - boost::hash >, - std::equal_to >, Allocator>; + Allocator) -> unordered_multimap, T, + boost::hash >, + std::equal_to >, Allocator>; template > > unordered_multimap(std::initializer_list >, Allocator) - -> unordered_multimap, T, - boost::hash >, - std::equal_to >, Allocator>; + -> unordered_multimap, T, + boost::hash >, + std::equal_to >, Allocator>; template >, class = boost::enable_if_t > > unordered_multimap(std::initializer_list >, std::size_t, - Hash, Allocator) -> unordered_multimap, T, - Hash, std::equal_to >, Allocator>; + Hash, Allocator) -> unordered_multimap, T, Hash, + std::equal_to >, Allocator>; #endif @@ -1428,8 +1430,8 @@ namespace boost { template void unordered_map::swap(unordered_map& other) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value) + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value) { table_.swap(other.table_); } @@ -1956,8 +1958,8 @@ namespace boost { template void unordered_multimap::swap(unordered_multimap& other) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value) + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value) { table_.swap(other.table_); } diff --git a/include/boost/unordered/unordered_node_map.hpp b/include/boost/unordered/unordered_node_map.hpp index 0c6a4e4c..3defba3f 100644 --- a/include/boost/unordered/unordered_node_map.hpp +++ b/include/boost/unordered/unordered_node_map.hpp @@ -99,9 +99,9 @@ namespace boost { using init_type = typename map_types::init_type; using size_type = std::size_t; using difference_type = std::ptrdiff_t; - using hasher = typename boost::type_identity::type; - using key_equal = typename boost::type_identity::type; - using allocator_type = typename boost::type_identity::type; + using hasher = typename boost::unordered::detail::type_identity::type; + using key_equal = typename boost::unordered::detail::type_identity::type; + using allocator_type = typename boost::unordered::detail::type_identity::type; using reference = value_type&; using const_reference = value_type const&; using pointer = typename boost::allocator_pointer::type; @@ -822,8 +822,8 @@ namespace boost { Allocator>; template >, - class Pred = std::equal_to >, + class Hash = boost::hash >, + class Pred = std::equal_to >, class Allocator = std::allocator >, class = boost::enable_if_t >, class = boost::enable_if_t >, @@ -831,7 +831,7 @@ namespace boost { unordered_node_map(std::initializer_list >, std::size_t = boost::unordered::detail::foa::default_bucket_count, Hash = Hash(), Pred = Pred(), Allocator = Allocator()) - -> unordered_node_map, T, Hash, Pred, + -> unordered_node_map, T, Hash, Pred, Allocator>; template > > unordered_node_map(std::initializer_list >, std::size_t, - Allocator) -> unordered_node_map, T, - boost::hash >, - std::equal_to >, Allocator>; + Allocator) -> unordered_node_map, T, + boost::hash >, + std::equal_to >, Allocator>; template > > unordered_node_map(std::initializer_list >, Allocator) - -> unordered_node_map, T, - boost::hash >, - std::equal_to >, Allocator>; + -> unordered_node_map, T, + boost::hash >, + std::equal_to >, Allocator>; template >, class = boost::enable_if_t > > unordered_node_map(std::initializer_list >, std::size_t, - Hash, Allocator) -> unordered_node_map, T, - Hash, std::equal_to >, Allocator>; + Hash, Allocator) -> unordered_node_map, T, + Hash, std::equal_to >, Allocator>; #endif } // namespace unordered diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index ba217e01..a892583b 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -145,8 +145,8 @@ namespace boost { unordered_set& operator=(unordered_set&& x) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_move_assignable::value&& - boost::is_nothrow_move_assignable

::value) + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_assignable

::value) { table_.move_assign(x.table_, std::true_type()); return *this; @@ -303,8 +303,8 @@ namespace boost { void swap(unordered_set&) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value); + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value); void clear() noexcept { table_.clear_impl(); } template @@ -638,8 +638,8 @@ namespace boost { unordered_multiset& operator=(unordered_multiset&& x) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_move_assignable::value&& - boost::is_nothrow_move_assignable

::value) + std::is_nothrow_move_assignable::value&& + std::is_nothrow_move_assignable

::value) { table_.move_assign(x.table_, std::false_type()); return *this; @@ -770,8 +770,8 @@ namespace boost { void swap(unordered_multiset&) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value); + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value); void clear() noexcept { table_.clear_impl(); } template @@ -1214,8 +1214,8 @@ namespace boost { template void unordered_set::swap(unordered_set& other) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value) + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value) { table_.swap(other.table_); } @@ -1611,8 +1611,8 @@ namespace boost { template void unordered_multiset::swap(unordered_multiset& other) noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_swappable::value&& - boost::is_nothrow_swappable

::value) + boost::unordered::detail::is_nothrow_swappable::value&& + boost::unordered::detail::is_nothrow_swappable

::value) { table_.swap(other.table_); } diff --git a/test/helpers/test.hpp b/test/helpers/test.hpp index feee7cc9..f87878ad 100644 --- a/test/helpers/test.hpp +++ b/test/helpers/test.hpp @@ -6,10 +6,15 @@ #if !defined(BOOST_UNORDERED_TEST_TEST_HEADER) #define BOOST_UNORDERED_TEST_TEST_HEADER -#include #include #include #include +#include + +#include +#include +#include +#include #define UNORDERED_AUTO_TEST(x) \ struct BOOST_PP_CAT(x, _type) : public ::test::registered_test_base \ @@ -120,7 +125,7 @@ namespace test { static state instance; return instance; } -} +} // namespace test #if defined(__cplusplus) #define BOOST_UNORDERED_CPLUSPLUS __cplusplus @@ -184,7 +189,7 @@ namespace test { #define UNORDERED_MULTI_TEST_OP2(name, n, params) \ { \ UNORDERED_SUB_TEST(BOOST_PP_STRINGIZE( \ - BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params))) \ + BOOST_PP_SEQ_FOLD_LEFT(UNORDERED_TEST_OP_JOIN, name, params))) \ { \ for (int i = 0; i < n; ++i) \ name BOOST_PP_SEQ_TO_TUPLE(params); \