From 7e23c2b43c682564e0c1f13feac0f40c7ecf676d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 18 Dec 2024 18:54:01 +0000 Subject: [PATCH] Document module support. --- doc/html/boost_regex/install.html | 6 +- doc/html/boost_regex/intro.html | 6 +- doc/html/boost_regex/modules.html | 108 ++++++++++++++++++++++++++++++ doc/html/index.html | 1 + doc/modules.qbk | 40 +++++++++++ doc/regex.qbk | 1 + 6 files changed, 156 insertions(+), 6 deletions(-) create mode 100644 doc/html/boost_regex/modules.html create mode 100644 doc/modules.qbk diff --git a/doc/html/boost_regex/install.html b/doc/html/boost_regex/install.html index 8cb6a338..cbfdf01a 100644 --- a/doc/html/boost_regex/install.html +++ b/doc/html/boost_regex/install.html @@ -7,7 +7,7 @@ - + @@ -21,7 +21,7 @@
-PrevUpHomeNext +PrevUpHomeNext

@@ -109,7 +109,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_regex/intro.html b/doc/html/boost_regex/intro.html index eb27e534..96ad6eb7 100644 --- a/doc/html/boost_regex/intro.html +++ b/doc/html/boost_regex/intro.html @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@
-PrevUpHomeNext +PrevUpHomeNext

@@ -206,7 +206,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_regex/modules.html b/doc/html/boost_regex/modules.html new file mode 100644 index 00000000..69538fe6 --- /dev/null +++ b/doc/html/boost_regex/modules.html @@ -0,0 +1,108 @@ + + + +Module Support (Experimental) + + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This library has experimental support for C++ modules (C++20 or later), currently + the support is experimental not least because at the time of writing (2025) + build tools have yet to catch up with module support. +

+

+ In order to use this library as a module you simply add a: +

+
import boost.regex;
+
+

+ to your code. +

+

+ Before that you must first build the module, which consists of these steps: +

+
    +
  • + Depending on your compiler, you may need to build the standard library + module, and place the standard module somewhere that your compiler can + find it. +
  • +
  • + Build libs/regex/module/regex.cxx into the boost.regex module, and + place the module definition file somewhere that your compiler can find + it. +
  • +
  • + Build all the source files in libs/regex/module + (including regex.cxx) into a library, and place the result somewhere your + linker can find it. +
  • +
+

+ Visual studio users can simplify all of the above into one step, by placing + everything in libs/regex/module + into a static library project, and then adding the /interface command line option to the regex.cxx + source file. +

+

+ Known limitations: +

+
    +
  • + As of the start of 2025, only very recent versions of clang and msvc are + supported. GCC is definitely not supported. +
  • +
  • + The regex library must always be consumed via import + boost.regex; + and you can never mix this with #includes + <boost/regex.hpp>. +
  • +
  • + Ideally the standard library should always be used via import + std and not via #includes: more + recent compilers are mostly making this work, but are still very fragile. +
  • +
  • + The regex version imported, is always the "standalone" version + which includes no other Boost headers. +
  • +
+

+ Finally... there are some build and test scripts in libs/regex/test/module + for msvc and clang. +

+
+ +
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/index.html b/doc/html/index.html index 639afd79..d082acfc 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -50,6 +50,7 @@
Algorithm Tuning
Building and Installing the Library
+
Module Support (Experimental)
Introduction and Overview
Unicode and Boost.Regex
Understanding Marked Sub-Expressions diff --git a/doc/modules.qbk b/doc/modules.qbk new file mode 100644 index 00000000..6358c23b --- /dev/null +++ b/doc/modules.qbk @@ -0,0 +1,40 @@ +[/ + Copyright 2024 John Maddock. + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +] + +[section:modules Module Support (Experimental)] + +This library has experimental support for C++ modules (C++20 or later), currently the support is experimental +not least because at the time of writing (2025) build tools have yet to catch up with module support. + +In order to use this library as a module you simply add a: + +``` +import boost.regex; +``` + +to your code. + +Before that you must first build the module, which consists of these steps: + +* Depending on your compiler, you may need to build the standard library module, and place the standard module somewhere that your compiler can find it. +* Build `libs/regex/module/regex.cxx` into the boost.regex module, and place the module definition file somewhere that your compiler can find it. +* Build all the source files in `libs/regex/module` (including regex.cxx) into a library, and place the result somewhere your linker can find it. + +Visual studio users can simplify all of the above into one step, by placing everything in `libs/regex/module` into a static library project, and then adding the `/interface` +command line option to the regex.cxx source file. + +Known limitations: + +* As of the start of 2025, only very recent versions of clang and msvc are supported. GCC is definitely not supported. +* The regex library must always be consumed via `import boost.regex;` and you can never mix this with `#includes `. +* Ideally the standard library should always be used via `import std` and not via #includes: more recent compilers are mostly making this work, but are still very fragile. +* The regex version imported, is always the "standalone" version which includes no other Boost headers. + +Finally... there are some build and test scripts in `libs/regex/test/module` for msvc and clang. + +[endsect] + diff --git a/doc/regex.qbk b/doc/regex.qbk index bc3d8103..ebad5c2e 100644 --- a/doc/regex.qbk +++ b/doc/regex.qbk @@ -51,6 +51,7 @@ PDF version of this manual is also available]. [include configuration.qbk] [include install.qbk] +[include modules.qbk] [include introduction.qbk] [include unicode.qbk] [include captures.qbk]