Reimplement type_name with class templates to avoid instantiating types such as pair<void, void> and tuple<void>

This commit is contained in:
Peter Dimov
2021-10-08 09:23:26 +03:00
parent 8cf4d16297
commit 41c3b6a7dd
2 changed files with 559 additions and 324 deletions

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,10 @@
# include <array> # include <array>
#endif #endif
#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
# include <tuple>
#endif
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
# include <string_view> # include <string_view>
#endif #endif
@ -265,6 +269,9 @@ int main()
TEST(std::pair<A, B>); TEST(std::pair<A, B>);
TEST(std::pair<A const*, B*> volatile&); TEST(std::pair<A const*, B*> volatile&);
TEST(std::pair<void, void>);
TEST(std::pair<std::pair<void, void>, void>);
TEST(std::basic_string<Ch>); TEST(std::basic_string<Ch>);
TEST(std::string); TEST(std::string);
@ -286,6 +293,8 @@ int main()
TEST(X<A, B>); TEST(X<A, B>);
TEST(X<A const&, B&> volatile&); TEST(X<A const&, B&> volatile&);
TEST(X<std::pair<void, void>, void>);
TEST(std::vector<int>); TEST(std::vector<int>);
TEST(std::vector<A>); TEST(std::vector<A>);
TEST(std::vector<std::string>); TEST(std::vector<std::string>);
@ -326,6 +335,23 @@ int main()
TEST(std::array<std::string, 7>); TEST(std::array<std::string, 7>);
TEST(std::array<std::wstring const*, 0> const&); TEST(std::array<std::wstring const*, 0> const&);
#endif
#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
TEST(std::tuple<>);
TEST(std::tuple<int>);
TEST(std::tuple<int, float>);
TEST(std::tuple<int, float, std::string>);
TEST(std::tuple<void>);
TEST(std::tuple<void, void>);
TEST(std::tuple<void, void, void>);
TEST(std::tuple<std::tuple<void, void>, void>);
TEST(X<std::tuple<void>, void>);
#endif #endif
TEST(std::ostream); TEST(std::ostream);