
Was it ever discussed to partially preprocess the sources to generate a modules-only distribution without #includes and with only imports? Still single-source, with macros and such (which is a burden for maintainers), but generating a "cleaned-up" modules-only source package for those who want to opt in to modules. Kind of like a module-based Boost 2.0 but without it being a fork. And pushing it a little further, preprocess out pre-C++20 compiler workarounds too—why not? If this was discussed, I missed it on the mailing list. But perhaps it's too preposterous to even be discussed. :) I thought such idea roughly. But I never saw such discussion anywhere. I guess the reason maybe it sounds hard? I wrote a tool to help refactoring projects to modules (https://github.com/ChuanqiXu9/clang-modules-converter <https://github.com/ChuanqiXu9/clang-modules-converter >). But given the complexity of C++, it is only a semi-automated process. There was a only a paper to do such things (https://onlinelibrary.wiley.com/doi/full/10.1002/smr.2736 <https://onlinelibrary.wiley.com/doi/full/10.1002/smr.2736 >). But all of this are semi-auto. It means more burden to maintainers. And from what we proposed so far, actually you can find the maintain burden won’t be so large. It is basically to #ifdef some headers and add a macro to a decl. It is trivial. I guess people may be more frustrated to fight for the auto genetated mess. But as you said, these are merely ideas. No one ever try to do it in the long way. Thanks, Chuanqi
Chuanqi Xu wrote:
But another concern is, given boost (or any other library) should be accepted by other compilers and older clang. Then how could we put `export` in the sources directly? Didn’t we have to use yet another macro to handle this?
That's a good point, yes. Since in pre-20 mode we have to remove the `export` anyway, there's perhaps not much point in having ignorable `export`.
Or... maybe there still is, because we could at least use a single Config macro BOOST_CXX20_EXPORT, instead of separate ones per library. Just a thought from the peanut gallery here... Was it ever discussed to partially preprocess the sources to generate a modules-only distribution without #includes and with only imports? Still single-source, with macros and such (which is a burden for
From:Dominique Devienne via Boost