diff --git a/include/boost/unordered/concurrent_flat_map.hpp b/include/boost/unordered/concurrent_flat_map.hpp index d6d5937c..2a70ea67 100644 --- a/include/boost/unordered/concurrent_flat_map.hpp +++ b/include/boost/unordered/concurrent_flat_map.hpp @@ -795,6 +795,97 @@ namespace boost { return c.erase_if(pred); } +#ifdef BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES + + template >, + class Pred = + std::equal_to >, + class Allocator = std::allocator< + boost::unordered::detail::iter_to_alloc_t >, + class = boost::enable_if_t >, + class = boost::enable_if_t >, + class = boost::enable_if_t >, + class = boost::enable_if_t > > + concurrent_flat_map(InputIterator, InputIterator, + std::size_t = boost::unordered::detail::foa::default_bucket_count, + Hash = Hash(), Pred = Pred(), Allocator = Allocator()) + -> concurrent_flat_map< + boost::unordered::detail::iter_key_t, + boost::unordered::detail::iter_val_t, Hash, Pred, + Allocator>; + + template >, + class Pred = std::equal_to >, + class Allocator = std::allocator >, + class = boost::enable_if_t >, + class = boost::enable_if_t >, + class = boost::enable_if_t > > + 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, + Allocator>; + + template >, + class = boost::enable_if_t > > + concurrent_flat_map(InputIterator, InputIterator, std::size_t, Allocator) + -> concurrent_flat_map< + boost::unordered::detail::iter_key_t, + boost::unordered::detail::iter_val_t, + boost::hash >, + std::equal_to >, + Allocator>; + + template >, + class = boost::enable_if_t > > + concurrent_flat_map(InputIterator, InputIterator, Allocator) + -> concurrent_flat_map< + boost::unordered::detail::iter_key_t, + boost::unordered::detail::iter_val_t, + boost::hash >, + std::equal_to >, + Allocator>; + + template >, + class = boost::enable_if_t >, + class = boost::enable_if_t > > + concurrent_flat_map( + InputIterator, InputIterator, std::size_t, Hash, Allocator) + -> concurrent_flat_map< + boost::unordered::detail::iter_key_t, + boost::unordered::detail::iter_val_t, Hash, + std::equal_to >, + Allocator>; + + template > > + concurrent_flat_map(std::initializer_list >, std::size_t, + 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>; + + 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>; + +#endif + } // namespace unordered using unordered::concurrent_flat_map; diff --git a/include/boost/unordered/detail/type_traits.hpp b/include/boost/unordered/detail/type_traits.hpp index fd37a8e4..838611ce 100644 --- a/include/boost/unordered/detail/type_traits.hpp +++ b/include/boost/unordered/detail/type_traits.hpp @@ -20,6 +20,9 @@ #include #include #include + +#include +#include #endif // BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES @@ -101,6 +104,16 @@ namespace boost { !boost::is_integral::value && !is_allocator_v; template constexpr bool const is_pred_v = !is_allocator_v

; + + template + using iter_key_t = + typename std::iterator_traits::value_type::first_type; + template + using iter_val_t = + typename std::iterator_traits::value_type::second_type; + template + using iter_to_alloc_t = + typename std::pair const, iter_val_t >; #endif } // namespace detail } // namespace unordered diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index 23a13438..9597d26f 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -741,18 +741,6 @@ namespace boost { #if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES - namespace detail { - template - using iter_key_t = - typename std::iterator_traits::value_type::first_type; - template - using iter_val_t = - typename std::iterator_traits::value_type::second_type; - template - using iter_to_alloc_t = - typename std::pair const, iter_val_t >; - } // namespace detail - template >, diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 8a8bc062..35eb2f2e 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -1061,18 +1061,6 @@ namespace boost { #if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES - namespace detail { - template - using iter_key_t = - typename std::iterator_traits::value_type::first_type; - template - using iter_val_t = - typename std::iterator_traits::value_type::second_type; - template - using iter_to_alloc_t = - typename std::pair const, iter_val_t >; - } // namespace detail - template >, diff --git a/include/boost/unordered/unordered_node_map.hpp b/include/boost/unordered/unordered_node_map.hpp index 8d32ba0a..33e3c7c7 100644 --- a/include/boost/unordered/unordered_node_map.hpp +++ b/include/boost/unordered/unordered_node_map.hpp @@ -893,18 +893,6 @@ namespace boost { #if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES - namespace detail { - template - using iter_key_t = - typename std::iterator_traits::value_type::first_type; - template - using iter_val_t = - typename std::iterator_traits::value_type::second_type; - template - using iter_to_alloc_t = - typename std::pair const, iter_val_t >; - } // namespace detail - template >, diff --git a/test/unordered/deduction_tests.cpp b/test/unordered/deduction_tests.cpp index 7c942186..571aa7fa 100644 --- a/test/unordered/deduction_tests.cpp +++ b/test/unordered/deduction_tests.cpp @@ -13,6 +13,7 @@ #include #include +#include struct hash_equals { @@ -432,6 +433,7 @@ int main() map_tests(); map_tests(); map_tests(); + map_tests(); set_tests(); set_tests(); set_tests();