Re: partial specialization
Jack Hanebach <firstname@lastname.net> wrote:
Igor Tandetnik wrote:
The reason is the same as for function
templates: member functions can be overloaded, and then there's no
way to uniquely specify which overload you are specializing: just a
function name is insufficient.
I'm not sure I know what you mean. I can see a problem with templated
methods - with non-template ones I cannot see a problem unique to
partial specialization. Maybe I'm missing something, can you sho an
example?
template <typename T, typename U>
struct A {
void foo(T*);
void foo(U);
};
template <typename V>
void A<V, V*>::foo(V*) {};
Besides, there's nothing wrong with compile error when ambiguity
arizes... :)
The standard defines a procedure for finding a suitable function given a
list of concrete types on one hand, and a set of lists of possibly
parameterized types on the other hand. The standard doesn't at all
address the situation where the "left-hand-side" list of types is itself
parameterized. The existing wording isn't directly applicable, new set
of rules will have to be designed. Which is probably not impossible, so
feel free to write a formal proposal and get it accepted.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925