C++ Modules - why were they removed from C++0x? Will they be back later on?

Viewed 32390

I just discovered this old C++0x draft about modules in C++0x.

The idea was to get out of the current .h/.cpp system by writing only .cpp files which would then generate module files during compilation, which would then in turn be used by the other .cpp files.

This looks like a really great feature.

But my question is: why did they remove it from C++0x? Was it because of too many technical difficulties? Lack of time? And do you think they will consider working on it for an ulterior version of C++?

4 Answers

Clang is the first compiler to start working on modules even before the standardization is complete. There is not much of a documentation yet, but example code could be found here:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/

Some comments from Douglas Gregor (the developer implementing them):
http://clang-developers.42468.n3.nabble.com/C-modules-td3619936.html

In theory, you can define a bunch of helper macros like begin_module, end_module, import_module to shield yourself from any likely changes to the syntax that will come in the future.

EDIT 1:
Douglas Gregor has released a presentation about his implementation:
http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf?=submit

EDIT 2:
The module support in clang have been documented here:
http://clang.llvm.org/docs/Modules.html

EDIT 3:
Modules are now supported in Microsoft's C++ compiler as well: http://blogs.msdn.com/b/vcblog/archive/2015/12/03/c-modules-in-vs-2015-update-1.aspx

Related