From: Thomas Tutone <thomas8675309@ya...> - 2003-12-06 19:46:55
"Adam Ryczkowski" <sisteczko@...> wrote:
> Is this true, that GCC doesn't support the 'export'
Yes, that's true. AFAIK, only one compiler family on
the planet - Edison Design Group's back-end combined
with the Comeau Computing front end - currently
supports export. None of Microsoft, Borland,
Metrowerks, etc. support it any more than gcc does.
> as well as compiling templates' definitions into
> object files?
What do you mean by this?
> (In The C++ Programming Language by B.Stroustrup
> the keyword 'export'
> was described as 'accessible from another
> translation unit' )
Amusingly enough, Stroustrup wrote that before ANY
compiler supported export. It was adopted into the
C++ standard (and therefore Stroustrup included its
description in his book) before anyone knew whether it
would even work. As it turns out, it has a lot of
issues that reduce its usefulness. Here's a couple of
links to some Herb Sutter articles discussing the
> Or, on the other hand, does the linker support
> template instantiation?
> And how to achieve it?
It's not entirely clear to me what it is you are
trying to achieve. If you are trying to increase the
speed of your builds, in some circumstances explicit
instantiation of a template in one .cpp file
eliminates the need to #include the template
definition in other .cpp files. This works just fine
in MinGW, and I have used this technique successfully
to reduce build times substantially when I am just
using a template for a single parametized type. For
more info, take a look at the C++ FAQ, specifically
sections 34.12, 34.13, and 34.14:
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.