H
Hendrik Schober
Hi,
this code
#include <iostream>
template< typename T >
struct X {
void f();
};
template<> void X<long>::f() {std::cout << "X<long>::f()\n";}
int main(int, char**)
{
X<long> xi;
xi.f();
return 0;
}
is accepted by GCC4, Comeau Online, and VC7.1.
I thought one cannot specialize only a member of a
class template, but has to specialize the whole
template. It seems that this isn't true?
TIA,
Hendrik Schober
--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org
"Coming back to where you started is not the same as never leaving"
Terry Pratchett
this code
#include <iostream>
template< typename T >
struct X {
void f();
};
template<> void X<long>::f() {std::cout << "X<long>::f()\n";}
int main(int, char**)
{
X<long> xi;
xi.f();
return 0;
}
is accepted by GCC4, Comeau Online, and VC7.1.
I thought one cannot specialize only a member of a
class template, but has to specialize the whole
template. It seems that this isn't true?
TIA,
Hendrik Schober
--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org
"Coming back to where you started is not the same as never leaving"
Terry Pratchett