From e68ec5c9a90694f814887cad0de45009809600b4 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 14 Feb 2023 09:38:36 -0800 Subject: [PATCH] Add foa-based node containers to compile_set tests --- test/unordered/compile_set.cpp | 387 ++++++++++++++++----------------- 1 file changed, 187 insertions(+), 200 deletions(-) diff --git a/test/unordered/compile_set.cpp b/test/unordered/compile_set.cpp index aa3721c6..40601d90 100644 --- a/test/unordered/compile_set.cpp +++ b/test/unordered/compile_set.cpp @@ -1,6 +1,6 @@ // Copyright 2006-2009 Daniel James. -// Copyright 2022 Christian Mazakas. +// 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) @@ -35,6 +35,21 @@ template class instantiate_flat_set, 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 #define INSTANTIATE(type) \ @@ -56,153 +71,106 @@ INSTANTIATE(multiset) set_type; -#else - typedef boost::unordered_set set_type; -#endif - - typedef set_type::iterator iterator; - +template static void type_traits_impl() +{ BOOST_STATIC_ASSERT(boost::is_same::reference>::value); + typename std::iterator_traits::reference>::value); } -UNORDERED_AUTO_TEST (test0) { +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