On Thu, 12 Apr 2001, Andrew Reilly wrote:
> On 11 Apr, Jim Edwards wrote:
> > The export keyword should do this, but I don't know of
>
> Really? I'm very surprised that anyone even thinks that this is
> possible.
It is actually quite simple (at least conceptually): when compiling the
template source, don't generate code, but put some intermediate form
(e.g. the parse tree or something equivalent, possibly even the plain
(tokenized) source) and the necessary context (about
dependent/nondepedendent) names into the library. Then make the linker
smart enough to make (at instantiation time) a callback to the compiler
with the now known values for the template parameters, so that actual code
can be generated. Instantiation may trigger other template instantiations
until this recursion ends (otherwise the source is buggy). The library
then works as some kind of template repository.
In the UNIX world this approach is difficult because the linker is a
system component and may not easily be replaced. I'm not sure why it isn't
done on Windows systems (where important system components are replaced
by nearly every program to be installed), but if I look at the "standard
conformance" of the Visual C++ compiler, then there are some more pressing
problems than supporting the export keyword ...
Hope this helps.
Ciao,
Manuel
_______________________________________________________________________
Dr. Manuel Kessler, Dipl.-Phys.
Institut fuer Aerodynamik und Gasdynamik
Universitaet Stuttgart
Pfaffenwaldring 21 ( ( ( ( ___________.^.___________ ) ) ) )
70550 Stuttgart / Germany _\I/_
/\_|_/\
Phone: +49 711 685 3435 \_(_)_/
Fax: +49 711 685 3438 ./ \.
E-Mail: kessler@iag.uni-stuttgart.de
WWW: http://www.iag.uni-stuttgart.de/people/manuel.kessler
_______________________________________________________________________
--------------------- 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