This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: explicit instantiation of methods bug.
- To: Andrew Fitzgibbon <awf at robots dot ox dot ac dot uk>
- Subject: Re: explicit instantiation of methods bug.
- From: "Mark Schaefer" <mschaefer at dsai dot com>
- Date: Sat, 4 Apr 1998 14:42:53 -0700
- Cc: egcs at cygnus dot com
- References: <199804031120.MAA20418@gertrude.robots.ox.ac.uk>
Andrew,
I'm not sure about the state of egcs, but what you are doing could
easily be considered a partial specialization. The SGI compiler, for instance,
would try to interpret your function as "Here's how I want to define A::f for
type double"
Also, from the snippet of the standard you gave, what you are doing is
neither a member template definition, nor a member function definition. You
should know that you can't declare a member function outside of the class
declaration so what does it fall into?
I'm not sure where I stand on template instantiation. According to
Stroustrup, the compiler should be smart enough to instantiate the proper
template code without operator intervention. I consider it cheesy to insist
(like gcc 7.2 did, at least) that the user explicitly tell the compiler when he
planned to instantiate a template.
I think a lot of compilers (SGI included) have a very hard time with
template dependencies, especially when the instantiation comes from a library
function call.
--
Mark Schaefer