
#ifdef BOOST_USE_MODULES import boost.mp11; import boost.core; import std; #else #include
#include #include #endif and I'm not sure that this is what we want. I feel this may not be too bad from a user’s perspective. Rather, my current thinking is that we want this for user code: #include
#include #include On the one hand, I feel the readability is not so good. On the other hand, the standard wording may not want this: In a module unit, all module-import-declarations and export-declarations exporting module-import-declarations shall appear before all other declarations in the declaration-seq of the translation-unit and of the private-module-fragment (if any). from https://eel.is/c++draft/module.import#1 <https://eel.is/c++draft/module.import#1 >https://eel.is/c++draft/module.import#1 <https://eel.is/c++draft/module.import#1 > Thanks, Chuanqi
Hi all,
I finally have something workable regarding Boost and C++20 modules. I've described it in detail in this article [1], but here's a rough summary:
I've modularized Boost.Mp11 [2] (as an example of a header-only library) and Boost.Charconv [3] (as an example of a compiled library). ... Other than that, I'd like to get some feedback on this, and whether you think this proposal is worth the effort. I looked at the Mp11 patch, and I think I don't quite like this approach. At present, user code needs to look like this #ifdef BOOST_USE_MODULES import boost.mp11; import boost.core; import std; #else #include
#include #include #endif and I'm not sure that this is what we want. Rather, my current thinking is that we want this for user code: #include #include #include with boost/mp11/this.hpp being #ifdef BOOST_USE_MODULES import boost.mp11; #else #include #endif This would presume that does something similar, which is in fact one suggested implementation strategy. If not, we'll need #include #include #include which is not ideal, but is still better than what we started with. In the general case (when a header also defines macros), the public
From:Peter Dimov via Boost