From cfdfae0a6592704470f7868bce19a5ca81c933d7 Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Sun, 6 Oct 2024 22:38:00 -0500 Subject: [PATCH] Ensure each container type can be explicitly instantiated --- .../boost/unordered/concurrent_flat_map.hpp | 1 + .../boost/unordered/concurrent_flat_set.hpp | 1 + .../boost/unordered/concurrent_node_map.hpp | 1 + .../boost/unordered/concurrent_node_set.hpp | 1 + .../boost/unordered/unordered_flat_map.hpp | 1 + .../boost/unordered/unordered_flat_set.hpp | 1 + .../boost/unordered/unordered_node_map.hpp | 1 + .../boost/unordered/unordered_node_set.hpp | 1 + test/Jamfile.v2 | 4 +++ test/cfoa/explicit_instantiation_tests.cpp | 15 ++++++++++ .../explicit_instantiation_tests.cpp | 29 +++++++++++++++++++ 11 files changed, 56 insertions(+) create mode 100644 test/cfoa/explicit_instantiation_tests.cpp create mode 100644 test/unordered/explicit_instantiation_tests.cpp diff --git a/include/boost/unordered/concurrent_flat_map.hpp b/include/boost/unordered/concurrent_flat_map.hpp index f957b0a5..150cf413 100644 --- a/include/boost/unordered/concurrent_flat_map.hpp +++ b/include/boost/unordered/concurrent_flat_map.hpp @@ -190,6 +190,7 @@ namespace boost { } + template concurrent_flat_map( unordered_flat_map&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/concurrent_flat_set.hpp b/include/boost/unordered/concurrent_flat_set.hpp index 9aa2c8cc..6dad67e5 100644 --- a/include/boost/unordered/concurrent_flat_set.hpp +++ b/include/boost/unordered/concurrent_flat_set.hpp @@ -187,6 +187,7 @@ namespace boost { } + template concurrent_flat_set( unordered_flat_set&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/concurrent_node_map.hpp b/include/boost/unordered/concurrent_node_map.hpp index 0b3eb2d9..b5dc0786 100644 --- a/include/boost/unordered/concurrent_node_map.hpp +++ b/include/boost/unordered/concurrent_node_map.hpp @@ -197,6 +197,7 @@ namespace boost { { } + template concurrent_node_map( unordered_node_map&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/concurrent_node_set.hpp b/include/boost/unordered/concurrent_node_set.hpp index cea51919..4d1193db 100644 --- a/include/boost/unordered/concurrent_node_set.hpp +++ b/include/boost/unordered/concurrent_node_set.hpp @@ -194,6 +194,7 @@ namespace boost { { } + template concurrent_node_set( unordered_node_set&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index a6551b3a..6ad25d8e 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -182,6 +182,7 @@ namespace boost { { } + template unordered_flat_map( concurrent_flat_map&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/unordered_flat_set.hpp b/include/boost/unordered/unordered_flat_set.hpp index 3b6eb3c2..8e925931 100644 --- a/include/boost/unordered/unordered_flat_set.hpp +++ b/include/boost/unordered/unordered_flat_set.hpp @@ -178,6 +178,7 @@ namespace boost { { } + template unordered_flat_set( concurrent_flat_set&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/unordered_node_map.hpp b/include/boost/unordered/unordered_node_map.hpp index c60a94e6..6f644dc0 100644 --- a/include/boost/unordered/unordered_node_map.hpp +++ b/include/boost/unordered/unordered_node_map.hpp @@ -189,6 +189,7 @@ namespace boost { { } + template unordered_node_map( concurrent_node_map&& other) : table_(std::move(other.table_)) diff --git a/include/boost/unordered/unordered_node_set.hpp b/include/boost/unordered/unordered_node_set.hpp index e8fb8b65..537f305e 100644 --- a/include/boost/unordered/unordered_node_set.hpp +++ b/include/boost/unordered/unordered_node_set.hpp @@ -187,6 +187,7 @@ namespace boost { { } + template unordered_node_set( concurrent_node_set&& other) : table_(std::move(other.table_)) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 2a672999..ea3adea9 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -163,6 +163,10 @@ compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_MULTIM compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_SET : insert_node_type_fail_set ; compile-fail unordered/insert_node_type_fail.cpp : UNORDERED_TEST_MULTISET : insert_node_type_fail_multiset ; +compile unordered/explicit_instantiation_tests.cpp : : fca_explicit_instantiation_tests ; +compile unordered/explicit_instantiation_tests.cpp : BOOST_UNORDERED_FOA_TESTS : foa_explicit_instantiation_tests ; +compile cfoa/explicit_instantiation_tests.cpp : : cfoa_explicit_instantiation_tests ; + local FCA_EXCEPTION_TESTS = constructor_exception_tests copy_exception_tests diff --git a/test/cfoa/explicit_instantiation_tests.cpp b/test/cfoa/explicit_instantiation_tests.cpp new file mode 100644 index 00000000..3815ba4d --- /dev/null +++ b/test/cfoa/explicit_instantiation_tests.cpp @@ -0,0 +1,15 @@ +// Copyright 2024 Braden Ganetsky +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include +#include + +template class boost::concurrent_flat_map; +template class boost::concurrent_flat_set; +template class boost::concurrent_node_map; +template class boost::concurrent_node_set; + +int main() { return 0; } diff --git a/test/unordered/explicit_instantiation_tests.cpp b/test/unordered/explicit_instantiation_tests.cpp new file mode 100644 index 00000000..cb88b8ef --- /dev/null +++ b/test/unordered/explicit_instantiation_tests.cpp @@ -0,0 +1,29 @@ +// Copyright 2024 Braden Ganetsky +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#ifdef BOOST_UNORDERED_FOA_TESTS + +#include +#include +#include +#include + +template class boost::unordered_flat_map; +template class boost::unordered_flat_set; +template class boost::unordered_node_map; +template class boost::unordered_node_set; + +#else + +#include +#include + +template class boost::unordered_map; +template class boost::unordered_multimap; +template class boost::unordered_multiset; +template class boost::unordered_set; + +#endif // BOOST_UNORDERED_FOA_TESTS + +int main() { return 0; }