diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index 4e4d7ca..319cad6 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -460,13 +460,14 @@ class flat_tree private: typedef allocator_traits stored_allocator_traits; + + public: typedef typename container_detail::if_c ::type get_stored_allocator_const_return_t; typedef typename container_detail::if_c ::type get_stored_allocator_noconst_return_t; - public: BOOST_CONTAINER_FORCEINLINE flat_tree() : m_data() { } diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index 0548e91..d87f7bd 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -158,6 +158,11 @@ class flat_map { return m_flat_tree; } private: + typedef typename tree_t::get_stored_allocator_const_return_t get_stored_allocator_const_return_t; + typedef typename tree_t::get_stored_allocator_noconst_return_t get_stored_allocator_noconst_return_t; + typedef typename impl_tree_t::get_stored_allocator_const_return_t impl_get_stored_allocator_const_return_t; + typedef typename impl_tree_t::get_stored_allocator_noconst_return_t impl_get_stored_allocator_noconst_return_t; + #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED public: @@ -493,8 +498,11 @@ class flat_map //! Complexity: Constant. //! //! Note: Non-standard extension. - BOOST_CONTAINER_FORCEINLINE stored_allocator_type &get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW - { return container_detail::force(m_flat_tree.get_stored_allocator()); } + BOOST_CONTAINER_FORCEINLINE get_stored_allocator_noconst_return_t get_stored_allocator() BOOST_NOEXCEPT_OR_NOTHROW + { + impl_get_stored_allocator_noconst_return_t r = m_flat_tree.get_stored_allocator(); + return container_detail::force(r); + } //! Effects: Returns a reference to the internal allocator. //! @@ -503,8 +511,11 @@ class flat_map //! Complexity: Constant. //! //! Note: Non-standard extension. - BOOST_CONTAINER_FORCEINLINE const stored_allocator_type &get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW - { return container_detail::force(m_flat_tree.get_stored_allocator()); } + BOOST_CONTAINER_FORCEINLINE get_stored_allocator_const_return_t get_stored_allocator() const BOOST_NOEXCEPT_OR_NOTHROW + { + impl_get_stored_allocator_const_return_t r = m_flat_tree.get_stored_allocator(); + return container_detail::force(r); + } ////////////////////////////////////////////// // diff --git a/test/flat_map_test.cpp b/test/flat_map_test.cpp index ef5264c..ca0a3a1 100644 --- a/test/flat_map_test.cpp +++ b/test/flat_map_test.cpp @@ -88,14 +88,12 @@ namespace boost{ namespace container{ template class flat_map -< test::movable_and_copyable_int - , test::movable_and_copyable_int + < test::movable_and_copyable_int , test::movable_and_copyable_int , std::less , std::vector >; -} //container_detail { }} //boost::container #endif diff --git a/test/flat_set_test.cpp b/test/flat_set_test.cpp index 3f92e65..a092a74 100644 --- a/test/flat_set_test.cpp +++ b/test/flat_set_test.cpp @@ -86,7 +86,6 @@ template class flat_set , std::vector >; -} //container_detail { }} //boost::container #endif