Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

you wrong You can simply use modules with includes. If you will #include vector inside your purview then you will just get a copy of the vector in each translation unit. Not good, but works. On the other hand. If you include a vector inside the global module fragment, then the number of definitions will be actually 1, even if you include it twice in different modules.


Well, the standard says you can, but it doesn't actually work in practice in msvc, which is the only compiler that's supported modules for over a year.


gcc and clang implemented them too, but partialy.

My comment about this absolutely wrong point:

> all of your code need to use modules

With all three major compilers you can right now use modules and at the same time include some other dependencies.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: