[John Maddock]
5) Using the regex is an all or nothing affair, with msvc this works: import boost.regex; [...] as does: import std; import boost.regex; [...] But this blows up: #include <iostream> import boost.regex;
[Boris Kolpackov]
We have tried this with 17.10 preview4 and there is definitely an improvement.
Yep, this was recorded in our Changelog. See https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710-preview-1 (or https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710 if you're reading this in the near future after 17.10 has released for production): [STL Changelog]
* Wrapped the STL in extern "C++" as a temporary workaround to allow #include <meow> to coexist with import std; in the same translation unit, in that order. #4154 + The other order, import std; before #include <meow>, will still cause compiler errors. We're working on a long-term solution.
[Boris Kolpackov]
Having said that, when we tried to enable `import std;` in a more realistic project, things did fall apart pretty quickly due to what looks like hard to pin-point interactions between include and import.
If you can reduce this to something self-contained that rigorously follows our current implementation restriction of include-before-import, we would be happy to investigate. I know the experience is messy, but it's improving, and the only way it can improve is for eager early adopters (including me; the STL is the compiler's first and closest user) to report the problems they encounter so that "it doesn't work" can be resolved into fine-grained issues that can be fixed - see https://github.com/microsoft/STL/issues/1694 for the laundry list of bugs affecting the STL (which is a small subset of all modules bugs in the compiler that have been fixed) that we've been hammering away at since VS 2019 16.8 when I started looking into getting header units and then named modules working. Thanks, STL