Y
year1943
For
template <typename T> class My ;
I can define partial spec-ns somewhat like
template <typename T> class My<T*> ; or
template <typename T> class My<Another<T> > ;
And full spec-n, say
template <> class My<int> ;
What if I have a template class
template <typename T, typename U> class My ;
and want to have spec-ns like
template <typename T, typename> class My<T, int> ;
when spec-n is not "full", but one of template-parameters is "not
used"?
Is it possible? If it is, what is right syntax. For my tries GCC says
something like
60-tpl_partial.cpp:49: error: template parameters not used in partial
specialization:
60-tpl_partial.cpp:49: error: '<template-parameter-1-2>'
If it is not possible, what are reasons to prohibit that?
Thanx.
template <typename T> class My ;
I can define partial spec-ns somewhat like
template <typename T> class My<T*> ; or
template <typename T> class My<Another<T> > ;
And full spec-n, say
template <> class My<int> ;
What if I have a template class
template <typename T, typename U> class My ;
and want to have spec-ns like
template <typename T, typename> class My<T, int> ;
when spec-n is not "full", but one of template-parameters is "not
used"?
Is it possible? If it is, what is right syntax. For my tries GCC says
something like
60-tpl_partial.cpp:49: error: template parameters not used in partial
specialization:
60-tpl_partial.cpp:49: error: '<template-parameter-1-2>'
If it is not possible, what are reasons to prohibit that?
Thanx.