Topic: A module system (Was: underscores in names)


Author: Valentin Bonnard <bonnardv@pratique.fr>
Date: 1998/10/28
Raw View
Paul D. DeRocco wrote:

> It makes one wish for something like:
>
>         #pushandhidealldefinesexcept()
>         // library definitions
>         #popalldefines

That's usually called a module system.

// Foo.interface
#define xxx yyy
const int xxx = 3;

// Bar.implementation
uses Foo;

#ifdef xxx
#error "no, xxx is defined in another precompiler translation"
#error "unit, it is not visible here  "
#endif

cout << yyy; // 3

It's ok to use a precompiler in any language, but the language
should not use it as a module system.

--

Valentin Bonnard                mailto:bonnardv@pratique.fr
info about C++/a propos du C++: http://pages.pratique.fr/~bonnardv/


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]