Re: OON: Can separate compilation deal with expression templates ?

From: rainer_blome@de.ibm.com
Date: Fri Apr 20 2001 - 02:29:15 EST


Since the standard doesn't define how to implement compilation units,
truly separate compilation would require compiler vendors to agree on
a special C++ object file format, as far as I can see. As long as
separate template compilation technology is not commonplace, it would
be a competitive advantage which makes an agreement on a non-
proprietary format seem unlikely.

> both declarations and definitions in header files

For the purposes of code organization and `keeping the interface clean',
you can put the definitions in `.cpp'-files (or whatever your suffix is)
and include those from your header files, if your compiler requires it
(most if not all will). While you are at it, you might do the same for
your inline functions, for example with a `.inl' suffix.

// foo.hpp
class Foo {...};

#if defined(MY_INLINE) && MY_INLINE != 0
# include "foo.inl"
#endif

#if defined(MY_TEMPLATES_NEED_SOURCE) && MY_TEMPLATES_NEED_SOURCE != 0
# include "foo.cpp"
#endif

// EOF foo.hpp

Best Regards, Rainer Blome
_________________________________________________________________________
Rainer Blome rainer_blome@de.ibm.com
Infrastructure & Systems Management IBM Deutschland
Informationssysteme GmbH
Tel.: 069-6645-1223 Adr.: Lyoner Str.13, 60582 Frankfurt/Main
Mobil: 0170-794 1303 Post: PF 710453, 60494
Frankfurt/Main

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:15 EST