From 3f4d5fc56716bbcf8f8c255440cb16e399843273 Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Sun, 18 Aug 2024 11:22:07 -0500 Subject: [PATCH] Put instantiate_[fca] classes into their respective test file, instead of in the headers --- include/boost/unordered/detail/map.hpp | 17 -------------- include/boost/unordered/detail/set.hpp | 17 -------------- test/unordered/compile_map.cpp | 32 +++++++++++++++++++------- test/unordered/compile_set.cpp | 29 ++++++++++++++++------- 4 files changed, 45 insertions(+), 50 deletions(-) diff --git a/include/boost/unordered/detail/map.hpp b/include/boost/unordered/detail/map.hpp index a11d35ef..1d6c0682 100644 --- a/include/boost/unordered/detail/map.hpp +++ b/include/boost/unordered/detail/map.hpp @@ -41,23 +41,6 @@ namespace boost { typedef typename table::iterator iterator; typedef boost::unordered::insert_return_type_map insert_return_type; }; - - template - class instantiate_map - { - typedef boost::unordered_map container; - container x; - typename container::node_type node_type; - typename container::insert_return_type insert_return_type; - }; - - template - class instantiate_multimap - { - typedef boost::unordered_multimap container; - container x; - typename container::node_type node_type; - }; } } } diff --git a/include/boost/unordered/detail/set.hpp b/include/boost/unordered/detail/set.hpp index 6025e40e..7ae3b307 100644 --- a/include/boost/unordered/detail/set.hpp +++ b/include/boost/unordered/detail/set.hpp @@ -39,23 +39,6 @@ namespace boost { typedef boost::unordered::insert_return_type_set insert_return_type; }; - - 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; - }; } } } diff --git a/test/unordered/compile_map.cpp b/test/unordered/compile_map.cpp index b929ced8..c6464ec4 100644 --- a/test/unordered/compile_map.cpp +++ b/test/unordered/compile_map.cpp @@ -52,23 +52,39 @@ template class instantiate_node_map >; #else -#define INSTANTIATE(type) \ - template class boost::unordered::detail::instantiate_##type -INSTANTIATE(map), std::equal_to, +template +class instantiate_map +{ + typedef boost::unordered_map container; + container x; + typename container::node_type node_type; + typename container::insert_return_type insert_return_type; +}; + +template +class instantiate_multimap +{ + typedef boost::unordered_multimap container; + container x; + typename container::node_type node_type; +}; + +template class instantiate_map, std::equal_to, test::minimal::allocator >; -INSTANTIATE(multimap), +template class instantiate_multimap, std::equal_to, test::minimal::allocator >; -INSTANTIATE( - map), test::minimal::equal_to, test::minimal::allocator >; -INSTANTIATE(multimap), +template class instantiate_multimap, test::minimal::equal_to, test::minimal::allocator >; + #endif template