diff --git a/test/regress/main.cpp b/test/regress/main.cpp index 6cfabe5c..64ebdbb1 100644 --- a/test/regress/main.cpp +++ b/test/regress/main.cpp @@ -16,7 +16,6 @@ * DESCRIPTION: entry point for test program. */ -#define BOOST_REGEX_TEST_INSTANCES #include "test.hpp" #include "test_locale.hpp" #include @@ -103,3 +102,30 @@ void throw_exception(std::exception const & e) #endif +void test(const char& c, const test_regex_replace_tag& tag) +{ + do_test(c, tag); +} +void test(const char& c, const test_regex_search_tag& tag) +{ + do_test(c, tag); +} +void test(const char& c, const test_invalid_regex_tag& tag) +{ + do_test(c, tag); +} + +#ifndef BOOST_NO_WREGEX +void test(const wchar_t& c, const test_regex_replace_tag& tag) +{ + do_test(c, tag); +} +void test(const wchar_t& c, const test_regex_search_tag& tag) +{ + do_test(c, tag); +} +void test(const wchar_t& c, const test_invalid_regex_tag& tag) +{ + do_test(c, tag); +} +#endif diff --git a/test/regress/test.hpp b/test/regress/test.hpp index 712abd4a..2668abfe 100644 --- a/test/regress/test.hpp +++ b/test/regress/test.hpp @@ -33,8 +33,29 @@ // define test entry proc, this forwards on to the appropriate // real test: // +template +void do_test(const charT& c, const tagT& tag); + template void test(const charT& c, const tagT& tag) +{ + do_test(c, tag); +} +// +// make these non-templates to speed up compilation times: +// +void test(const char&, const test_regex_replace_tag&); +void test(const char&, const test_regex_search_tag&); +void test(const char&, const test_invalid_regex_tag&); + +#ifndef BOOST_NO_WREGEX +void test(const wchar_t&, const test_regex_replace_tag&); +void test(const wchar_t&, const test_regex_search_tag&); +void test(const wchar_t&, const test_invalid_regex_tag&); +#endif + +template +void do_test(const charT& c, const tagT& tag) { #ifndef BOOST_NO_STD_LOCALE test_info::set_typename(typeid(boost::basic_regex >).name()); @@ -217,30 +238,5 @@ void test_operators(); void test_overloads(); void test_unicode(); -// -// template instances: -// we pretty much have to instantiate these separately -// otherwise compilation times are really excessive... -// Unfortunately this doesn't work with SunPro: -// -#ifndef __SUNPRO_CC -#ifndef BOOST_REGEX_TEST_INSTANCES -#define template template<> -#endif - -template void test(const char&, const test_regex_replace_tag&); -template void test(const char&, const test_regex_search_tag&); -template void test(const char&, const test_invalid_regex_tag&); - -#ifndef BOOST_NO_WREGEX -template void test(const wchar_t&, const test_regex_replace_tag&); -template void test(const wchar_t&, const test_regex_search_tag&); -template void test(const wchar_t&, const test_invalid_regex_tag&); -#endif - -#ifndef BOOST_REGEX_TEST_INSTANCES -#undef template -#endif -#endif #endif