From 375d7157b64471d6d9cbe57d847732038a1a2019 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Mon, 24 Oct 2022 09:54:57 -0700 Subject: [PATCH] Add tests for missing typedefs in flat containers --- include/boost/unordered/unordered_flat_map.hpp | 3 +++ include/boost/unordered/unordered_flat_set.hpp | 3 +++ test/unordered/compile_tests.hpp | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index 2cb4135e..82aa4f16 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -75,6 +75,9 @@ namespace boost { using allocator_type = Allocator; using reference = value_type&; using const_reference = value_type const&; + using pointer = typename boost::allocator_pointer::type; + using const_pointer = + typename boost::allocator_const_pointer::type; using iterator = typename table_type::iterator; using const_iterator = typename table_type::const_iterator; diff --git a/include/boost/unordered/unordered_flat_set.hpp b/include/boost/unordered/unordered_flat_set.hpp index f0129485..a58151bb 100644 --- a/include/boost/unordered/unordered_flat_set.hpp +++ b/include/boost/unordered/unordered_flat_set.hpp @@ -57,6 +57,9 @@ namespace boost { using allocator_type = Allocator; using reference = value_type&; using const_reference = value_type const&; + using pointer = typename boost::allocator_pointer::type; + using const_pointer = + typename boost::allocator_const_pointer::type; using iterator = typename table_type::iterator; using const_iterator = typename table_type::const_iterator; diff --git a/test/unordered/compile_tests.hpp b/test/unordered/compile_tests.hpp index 65509e79..4aeaf61f 100644 --- a/test/unordered/compile_tests.hpp +++ b/test/unordered/compile_tests.hpp @@ -75,6 +75,14 @@ template void container_test(X& r, T const&) #endif typedef typename X::allocator_type allocator_type; + typedef typename X::pointer pointer; + typedef typename X::const_pointer const_pointer; + + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); + + BOOST_STATIC_ASSERT((boost::is_same::type>::value)); // value_type