S
shuisheng
Dear All,
I am confused about the template functions in template class. Such as I
have
template class A <class T, int n>
In side the class, I have
function A<T,n> fun() and
template function void A<T,n> fun <class T2, int n2>
So how to define them rightly?
template<class T, int n>
A<T, n> A<T,n>::fun()
{...}
template<class T2, int n2>
template<class T, int n>
A<T, n> A<T,n>::fun()
{...}
Are they right? For the first one as what I write, I think we can also
think it is a template function as A<T,n> A<T,n>::fun<T,n>(), am I
right?
I appreciate you kind help!
Regards!
Shuisheng
I am confused about the template functions in template class. Such as I
have
template class A <class T, int n>
In side the class, I have
function A<T,n> fun() and
template function void A<T,n> fun <class T2, int n2>
So how to define them rightly?
template<class T, int n>
A<T, n> A<T,n>::fun()
{...}
template<class T2, int n2>
template<class T, int n>
A<T, n> A<T,n>::fun()
{...}
Are they right? For the first one as what I write, I think we can also
think it is a template function as A<T,n> A<T,n>::fun<T,n>(), am I
right?
I appreciate you kind help!
Regards!
Shuisheng