diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index 5734e6c9..c98cb48d 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -33,8 +34,7 @@ namespace boost { static Key const& extract(init_type const& kv) { return kv.first; } static Key const& extract(value_type const& kv) { return kv.first; } - template - static void move_parts_to(value_type& x,F f) + template static void move_parts_to(value_type& x, F f) { // TODO: we probably need to launder here f(std::move(const_cast(x.first)), std::move(x.second)); diff --git a/include/boost/unordered/unordered_flat_set.hpp b/include/boost/unordered/unordered_flat_set.hpp index 7c586503..76fd3222 100644 --- a/include/boost/unordered/unordered_flat_set.hpp +++ b/include/boost/unordered/unordered_flat_set.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -32,8 +33,10 @@ namespace boost { using value_type = Key; static Key const& extract(value_type const& key) { return key; } - template - static void move_parts_to(value_type& x,F f) { f(std::move(x)); } + template static void move_parts_to(value_type& x, F f) + { + f(std::move(x)); + } }; using table_type = detail::foa::table +#include +#include +#else #include #include +#endif #include "../helpers/postfix.hpp" // clang-format on @@ -17,6 +23,7 @@ #include namespace insert_hint { +#ifndef BOOST_UNORDERED_FOA_TESTS UNORDERED_AUTO_TEST (insert_hint_empty) { typedef boost::unordered_multiset container; container x; @@ -90,9 +97,13 @@ namespace insert_hint { } } } - +#endif UNORDERED_AUTO_TEST (insert_hint_unique) { +#ifdef BOOST_UNORDERED_FOA_TESTS + typedef boost::unordered_flat_set container; +#else typedef boost::unordered_set container; +#endif container x; x.insert(x.cbegin(), 10); BOOST_TEST_EQ(x.size(), 1u); @@ -101,7 +112,11 @@ namespace insert_hint { } UNORDERED_AUTO_TEST (insert_hint_unique_single) { +#ifdef BOOST_UNORDERED_FOA_TESTS + typedef boost::unordered_flat_set container; +#else typedef boost::unordered_set container; +#endif container x; x.insert(10);