On 2012-11-19 20:43:22 +0000, Walter Bright <[email protected]> said:

On 11/17/2012 3:30 AM, bearophile wrote:
http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf

One thing to note what it doesn't do - it doesn't produce a "module" scope. As far as I can tell, the symbols in imported modules all go into the global scope.

It seems to be mainly a way of legitimizing precompiled headers.

It's better semantically than precompiled headers because you're importing symbols only from the modules you import, not those from modules imported indirectly. Just that would be an incredible cleanup.

It seems there are actually two models: you can make modules from existing headers (by writing module maps), or you can create modules directly by starting your .c/.cpp file with "export <module name>;" as can see on the Writing a Module slide. The former approach is introduced as the transitional model, the later as the futuristic one that requires no headers.

--
Michel Fortin
[email protected]
http://michelf.ca/

Reply via email to