Anyways, this time it's about non type parameter
long code, so I'll just simplify the problem
template <typename T, int s=0>
class Array
{
public:
Array( T*);
//blablabla
private:
int size;
T* arr;
}
I'm trying to separate the implementation from the header file , but how do I do this for the constructor?
this is what I did, but it obviously won't work
template<typename T>
Array<T>::Array( T* a)
:size((s>=0 ? s : 0)), //here is the problem
arr(a)
{
}
How do I use the 's' from the header file template??
something like template class Array::s ??

New Topic/Question
Reply




MultiQuote





|