G
Greg
Hi,
I would like to specify behavior of a class member relatively to
template implemetation. It works in usual cases but it seems to fail
with to templates when one of the two is specified...
Exemple:
template <class T, int Num>
class A
{
void foo ();
}
// The generic implementation is:
template <class T, int Num>
void
A<T,Num>
::foo ()
{
// generic code
}
// I would like to add a specific code when Num equals 2 fior
instance:
template <class T>
void
A<T,2>
::foo()
{
// an other code...
}
// But g++ 3.2.3 (on Redhat Fedora 5) does not like it
Is there any solution, knowing that a complete non-genric code is
possible (i.e. defined a void A<int,2>::foo() directly)?
Any help is appreciated.
Greg
I would like to specify behavior of a class member relatively to
template implemetation. It works in usual cases but it seems to fail
with to templates when one of the two is specified...
Exemple:
template <class T, int Num>
class A
{
void foo ();
}
// The generic implementation is:
template <class T, int Num>
void
A<T,Num>
::foo ()
{
// generic code
}
// I would like to add a specific code when Num equals 2 fior
instance:
template <class T>
void
A<T,2>
::foo()
{
// an other code...
}
// But g++ 3.2.3 (on Redhat Fedora 5) does not like it
Is there any solution, knowing that a complete non-genric code is
possible (i.e. defined a void A<int,2>::foo() directly)?
Any help is appreciated.
Greg