explicit instantiation of methods bug.
Mark Schaefer
mschaefer@dsai.com
Sat Apr 4 14:20:00 GMT 1998
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
More information about the Gcc
mailing list