jove
Member
Hello,
A template syntax problem
Class A has a member of Class B. Class B has template functions that operate on a reference of Class A.
I would then like to implement the template member functions of Class B in a seperate file that is included after Class A's, so Class A can include Class B and Class B's header file can just forward declare Class A.
But how do you implement a template function outside of the class? I have tried all kinds of syntax without much luck. Such as...
class Foo
{
public:
template < typename TypeT >
TypeT DoSomething( void );
};
template < typename TypeT >
TypeT
Foo:oSomething< TypeT >( void )
{
return TypeT();
}
If Foo was a template class you could implement the function outside of the class with similar syntax.
I am stuck.
BTW I am using CW, the carbonized version that can't debug in X.
A template syntax problem
Class A has a member of Class B. Class B has template functions that operate on a reference of Class A.
I would then like to implement the template member functions of Class B in a seperate file that is included after Class A's, so Class A can include Class B and Class B's header file can just forward declare Class A.
But how do you implement a template function outside of the class? I have tried all kinds of syntax without much luck. Such as...
class Foo
{
public:
template < typename TypeT >
TypeT DoSomething( void );
};
template < typename TypeT >
TypeT
Foo:oSomething< TypeT >( void )
{
return TypeT();
}
If Foo was a template class you could implement the function outside of the class with similar syntax.
I am stuck.
BTW I am using CW, the carbonized version that can't debug in X.