3 ms·
> Header, source like before. Allow putting all implementations in the source (including templates). Do you realize how hard this is to implement? This actuall
by creato 8y ago
> Header, source like before. Allow putting all implementations in the source (including templates).
Do you realize how hard this is to implement? This actually was part of the original C++ spec (export keyword), but no compiler successfully implemented it in a way that was compatible with other compilers, and it was deprecated.
This (and C++ modules) requires a standard intermediate representation of the language that all compilers share, otherwise compiler A can't use a module generated by compiler B.
This is why I've never really expected C++ modules to ever exist, or if they do, it will be in a form that is much more limited than most people want or expect. Either they'll only allow a subset of the language to exist in a module, or the feature won't be much different than the "pre-compiled header" feature offered by most C++ compilers), or modules won't be portable across compilers (and maybe even versions of the same compiler).
- bigcheesegs 8y agoThis has always been a problem in talking about modules in C++. Everyone has a different idea of what a module is. Currently every compiler except MSVC plans to make module files version locked. Different versions of the same compiler will use different module files. Personally I find little value in portable module files, as you need to be able to rebuild modules anyway to handle pretty much any change to compile flags.