// Copyright 2006-2009 Daniel James. // Copyright 2022-2023 Christian Mazakas. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // This test creates the containers with members that meet their minimum // requirements. Makes sure everything compiles and is defined correctly. #include "../helpers/unordered.hpp" #include "../helpers/test.hpp" #include "../objects/minimal.hpp" #include "./compile_tests.hpp" // Explicit instantiation to catch compile-time errors #ifdef BOOST_UNORDERED_FOA_TESTS // emulates what was already done for previous tests but without leaking to // the detail namespace // template class instantiate_flat_set { typedef boost::unordered_flat_set container; container x; }; template class instantiate_flat_set, std::equal_to, test::minimal::allocator >; template class instantiate_flat_set, test::minimal::equal_to, test::minimal::allocator >; template class instantiate_node_set { typedef boost::unordered_node_set container; container x; }; template class instantiate_node_set, std::equal_to, test::minimal::allocator >; template class instantiate_node_set, test::minimal::equal_to, test::minimal::allocator >; #else template class instantiate_set { typedef boost::unordered_set container; container x; typename container::node_type node_type; typename container::insert_return_type insert_return_type; }; template class instantiate_multiset { typedef boost::unordered_multiset container; container x; typename container::node_type node_type; }; template class instantiate_set, std::equal_to, test::minimal::allocator >; template class instantiate_multiset, std::equal_to, test::minimal::allocator >; template class instantiate_set, test::minimal::equal_to, test::minimal::allocator >; template class instantiate_multiset, test::minimal::equal_to, test::minimal::allocator >; #endif template static void type_traits_impl() { BOOST_STATIC_ASSERT(boost::is_same::reference>::value); } UNORDERED_AUTO_TEST (type_traits) { #ifdef BOOST_UNORDERED_FOA_TESTS type_traits_impl >(); type_traits_impl >(); #else type_traits_impl >(); type_traits_impl >(); #endif } template