![]() |
Home | Libraries | People | FAQ | More |
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:
libs/regex/module/regex.cxx
into the boost.regex module, and
place the module definition file somewhere that your compiler can find
it.
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:
import
boost.regex;
and you can never mix this with #includes
<boost/regex.hpp>
.
import
std
and not via #includes: more
recent compilers are mostly making this work, but are still very fragile.
Finally... there are some build and test scripts in libs/regex/test/module
for msvc and clang.