Hide key template instances behind factory functions.

And provide a separate "module library"
Update testing scripts.
This commit is contained in:
jzmaddock
2024-04-18 16:37:12 +01:00
parent fbfdda66fd
commit 2c0058a902
45 changed files with 489 additions and 362 deletions
+23 -2
View File
@@ -5,6 +5,23 @@ module;
#define BOOST_REGEX_USE_STD_MODULE
#endif
#if __has_include(<unicode/utypes.h>)
#if !defined(BOOST_REGEX_WITH_ICU)
#if defined(_MSC_FULL_VER)
#pragma message "ICU headers are available but building the Regex module with ICU support is turned OFF. Build with BOOST_REGEX_WITH_ICU=1 to turn it on, or BOOST_REGEX_WITH_ICU=0 to disable this message"
#else
# warning "ICU headers are available but building the Regex module with ICU support is turned OFF. Build with BOOST_REGEX_WITH_ICU=1 to turn it on, or BOOST_REGEX_WITH_ICU=0 to disable this message"
#endif
#elif BOOST_REGEX_WITH_ICU
# define BOOST_REGEX_HAS_ICU_HEADERS
#endif
#endif
#if defined(_WIN32) && __has_include(<windows.h>)
#include <windows.h>
#endif
@@ -52,7 +69,7 @@ module;
#include <cwchar>
#endif
#if __has_include(<unicode/utypes.h>)
#ifdef BOOST_REGEX_HAS_ICU_HEADERS
#include <unicode/utypes.h>
#include <unicode/uchar.h>
#include <unicode/coll.h>
@@ -74,8 +91,12 @@ import std.core;
#pragma warning(disable:5244)
#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Winclude-angled-in-module-purview"
#endif
#include <boost/regex.hpp>
#if __has_include(<unicode/utypes.h>)
#ifdef BOOST_REGEX_HAS_ICU_HEADERS
#include <boost/regex/icu.hpp>
#endif
+11
View File
@@ -0,0 +1,11 @@
module boost.regex;
namespace boost::re_detail_600 {
bool factory_find(perl_matcher<const char*, match_results<const char*>::allocator_type, regex::traits_type>& m)
{
return m.find();
}
}
+11
View File
@@ -0,0 +1,11 @@
module boost.regex;
namespace boost::re_detail_600 {
bool factory_match(perl_matcher<const char*, match_results<const char*>::allocator_type, regex::traits_type>& m)
{
return m.match();
}
}
+31
View File
@@ -0,0 +1,31 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <memory>
#endif
#ifndef BOOST_REGEX_DETAIL_NS
#define BOOST_REGEX_DETAIL_NS re_detail_600
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::detail {
std::shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<char, basic_regex<char>::traits_type> >
create_implemenation(const char* p1, const char* p2, basic_regex<char>::flag_type f, std::shared_ptr<boost::regex_traits_wrapper<basic_regex<char>::traits_type> > ptraits)
{
return create_implemenation<char, basic_regex<char>::flag_type, basic_regex<char>::traits_type>(p1, p2, f, ptraits);
}
}
+31
View File
@@ -0,0 +1,31 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <memory>
#endif
#ifndef BOOST_REGEX_DETAIL_NS
#define BOOST_REGEX_DETAIL_NS re_detail_600
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::detail {
std::shared_ptr<BOOST_REGEX_DETAIL_NS::basic_regex_implementation<wchar_t, basic_regex<wchar_t>::traits_type> >
create_implemenation(const wchar_t* p1, const wchar_t* p2, basic_regex<wchar_t>::flag_type f, std::shared_ptr<boost::regex_traits_wrapper<basic_regex<wchar_t>::traits_type> > ptraits)
{
return create_implemenation<wchar_t, basic_regex<wchar_t>::flag_type, basic_regex<wchar_t>::traits_type>(p1, p2, f, ptraits);
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_find(perl_matcher<std::string::iterator, match_results<std::string::iterator>::allocator_type, regex::traits_type>& m)
{
return m.find();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_match(perl_matcher<std::string::iterator, match_results<std::string::iterator>::allocator_type, regex::traits_type>& m)
{
return m.match();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_find(perl_matcher<std::wstring::iterator, match_results<std::wstring::iterator>::allocator_type, wregex::traits_type>& m)
{
return m.find();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_match(perl_matcher<std::wstring::iterator, match_results<std::wstring::iterator>::allocator_type, wregex::traits_type>& m)
{
return m.match();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_find(perl_matcher<std::string::const_iterator, match_results<std::string::const_iterator>::allocator_type, regex::traits_type>& m)
{
return m.find();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_match(perl_matcher<std::string::const_iterator, match_results<std::string::const_iterator>::allocator_type, regex::traits_type>& m)
{
return m.match();
}
}
+11
View File
@@ -0,0 +1,11 @@
module boost.regex;
namespace boost::re_detail_600 {
bool factory_find(perl_matcher<const wchar_t*, match_results<const wchar_t*>::allocator_type, wregex::traits_type>& m)
{
return m.find();
}
}
+11
View File
@@ -0,0 +1,11 @@
module boost.regex;
namespace boost::re_detail_600 {
bool factory_match(perl_matcher<const wchar_t*, match_results<const wchar_t*>::allocator_type, wregex::traits_type>& m)
{
return m.match();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_find(perl_matcher<std::wstring::const_iterator, match_results<std::wstring::const_iterator>::allocator_type, wregex::traits_type>& m)
{
return m.find();
}
}
+26
View File
@@ -0,0 +1,26 @@
#if defined(__cpp_lib_modules) || (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 193933523))
#define BOOST_REGEX_USE_STD_MODULE
#endif
#ifndef BOOST_REGEX_USE_STD_MODULE
module;
#include <string>
#endif
module boost.regex;
#ifdef BOOST_REGEX_USE_STD_MODULE
import std;
#endif
namespace boost::re_detail_600 {
bool factory_match(perl_matcher<std::wstring::const_iterator, match_results<std::wstring::const_iterator>::allocator_type, wregex::traits_type>& m)
{
return m.match();
}
}