S
SainTiss
Hi,
From what I've read in several places, it seems that explicit specialization
of member functions of class templates is allowed, but partial
specialization isn't:
template<class T, class R> class A {
void foo();
}
template <>
void A<int,double>::foo() {} // allowed
template<class T>
void A<T,double>::foo() {} // forbidden
However, when looking for justification in the ISO standard (final draft,
1996), it seems the first isn't explicitly allowed in there, and neither is
the second explicitly forbidden, even though the first seems to be used in
an example in 14.5.4.3
So does anyone know what the story is then? Does the standard really
allow/forbid this or not?
Thanks,
Hans
From what I've read in several places, it seems that explicit specialization
of member functions of class templates is allowed, but partial
specialization isn't:
template<class T, class R> class A {
void foo();
}
template <>
void A<int,double>::foo() {} // allowed
template<class T>
void A<T,double>::foo() {} // forbidden
However, when looking for justification in the ISO standard (final draft,
1996), it seems the first isn't explicitly allowed in there, and neither is
the second explicitly forbidden, even though the first seems to be used in
an example in 14.5.4.3
So does anyone know what the story is then? Does the standard really
allow/forbid this or not?
Thanks,
Hans