Which code example would you prefer? (If you could choose...)
Example A
// file bar.cppm export module foo:bar; ... // file bar1.cpp module foo:bar.impl1; import :bar; ... // file bar2.cpp module foo:bar.impl2; import :bar; ...Note: Neither foo:bar.impl1 nor foo:bar.impl2 are imported anywhere, so generating a BMI file for these is pointless.
Example B
// file bar.ixx export module foo:bar; ... // file bar1.cpp module foo:bar; ... // file bar2.cpp module foo:bar; ...Example A is what is currently supported by the C++ standard.
Example B is what is possible using the current implementation of the Microsoft C++ compiler (not yet in the standard).
Both variants achieve the same goal.
Which version do you think is easier to understand?
Previous related posts:
[link] [comments]




![Halpatiokee Park [Stuart, FL]](https://preview.redd.it/yc2jvtj3cr3h1.jpg?width=140&height=140&crop=1:1,smart&auto=webp&s=b2f1cd5287a887343d041998e03125d29890059e)










English (US) ·