John Maddock wrote:
I believe that modules are so important that you should drop everything and aim to release a modular version of Boost.
Never going to happen - I asked about modules around here recently, and there was very little interest.
I did as it happens I experimented further, and made Boost.Regex available as a module: https://github.com/boostorg/regex/pull/174 It compiles with msvc and nothing else, see for example: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105320.
I also tried with part of boost.math (https://github.com/boostorg/math/pull/783) and again ran into intractable gcc and clang issues.
I'm afraid my conclusion is that modules are simply not yet ready for prime time.
If they ever are. Modules can work for leaf libraries, but for libraries used as dependencies by other libraries, you'll encounter a situation where the same translation unit imports boost.lib or "boost/lib.hpp" in one place and then includes "boost/lib/something.hpp" in another, which is probably never going to work correctly. I suppose it might stand a chance if all the imports are done first, so that the include guard macros are defined. But I think that's not going to work in practice either. Basically, all Regex consumers also must respect the REGEX_AS_MODULE macro and switch to `import boost.regex`. Repeat per every library.