tbp wrote:
On Apr 4, 2005 11:54 AM, Nathan Sidwell <[EMAIL PROTECTED]> wrote:
Am i missing something obvious?
well, not 'obvious', but that is what [14.7.3]/2 says.
I especially don't quite get why specialization have to be defined
that way when non specialized version don't have to, ie that is legit:
namespace dummy {
struct foo {
template <int i> void f();
};
}
template<int i> void dummy::foo::f() { }
That's not a declaration, it's a definition of an already declared fn.
the case you had was a definition that was _also_ a declaration.
You can write
namespace dummy {
template<> void foo::f<666>(); // declaration
}
template<> void dummy:foo::f<666>() {} // definition
See the difference?
Although it is kind of quirky that you can declare member function
specializations
outside of the class, but not outside of the namespace.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
[EMAIL PROTECTED] :: http://www.planetfall.pwp.blueyonder.co.uk