R
Rex_chaos
Hi there,
I am writing a template class like
template <class T, int rank>
class TC {...};
In my case, I would like to partial specialize the class.
template <class T>
class TC<T,1> {...};
template <class T>
class TC<T,2> {...};
template <class T>
class TC<T,2> {...};
Within each class, there is a little change. A particular function
will be added to the class and the implementation of some function
will also be modified. I wonder it it's necessary to "copy and paste"
all the code from the original template class to the specialized one.
It's very annoying if I have to.
For this purpose, I wonder if it's better to use the inheritance
instead.
template <class T>
class TCOne ublic TC<T,1>
{...};
For my case, the efficiency is the most essential factor. Will it
lower the efficiency if I take the inheitance mechanism?
Thanks in advance.
I am writing a template class like
template <class T, int rank>
class TC {...};
In my case, I would like to partial specialize the class.
template <class T>
class TC<T,1> {...};
template <class T>
class TC<T,2> {...};
template <class T>
class TC<T,2> {...};
Within each class, there is a little change. A particular function
will be added to the class and the implementation of some function
will also be modified. I wonder it it's necessary to "copy and paste"
all the code from the original template class to the specialized one.
It's very annoying if I have to.
For this purpose, I wonder if it's better to use the inheritance
instead.
template <class T>
class TCOne ublic TC<T,1>
{...};
For my case, the efficiency is the most essential factor. Will it
lower the efficiency if I take the inheitance mechanism?
Thanks in advance.