tags:

views:

235

answers:

2
+12  Q: 

Modules in C++0x

Hi,

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++?

+12  A: 

From the State of C++ Evolution (Post San Francisco 2008), the Modules proposal was categorized as "Heading for a separate TR:"

These topics are deemed too important to wait for another standard after C++0x before being published, but too experimental to be finalised in time for the next Standard. Therefore, these features will be delivered by a technical report at the earliest opportunity.

The modules proposal just wasn't ready and waiting for it would have delayed finishing the C++0x standard. It wasn't really removed, it was just never incorporated into the working paper.

James McNellis
+2  A: 
  1. Because it is very big conceptual change.
  2. There is no real need of it as separation of the sources to h/cpp does the job
  3. Because C++ does not define how actual "modules" libraries are build. It leaves it to compiler developer and to linker.
  4. "Modules" are sometimes quite platform dependent, for example DLLs quite different from shared objects. So it is not so trivial to merge between these concepts.
Artyom
There certainly is a need. .h/.cpp is a ridiculously bad and outmoded workaround. A module system would be a big change, but it's one that the standard committee apparently considers important.
jalf