C
LIBS schrieb:
Hi camper ...
1. Spezialisierungen können bei mir auch innerhalb eines Klassetemplates stehen -- kein problem eigentlich ...
2. selbst wenn ich beide Spezialisierungen auf Namespace-Ebene deklariere habe ich den beschriebenen fehler ...
gruesse
Stimmt, war ich abwesend
Ein Versuch mit dem Comeau C++ Compiler ist aufschlussreich:
"ComeauTest.c", line 22: error: template parameter "T1" is not used in or cannot be
deduced from the template argument list of class template
"TEST<C>::test<Y<X<T1>::x, T2>>"
template<class T1, class T2>
^
Y<X<T1>::template x ist kein Kontext, in dem T1 deduziert werden kann (mit den jetzigen Regeln wäre es im Prinzip denkbar, spätestens wenn es template typedefs gibt, aber nicht mehr). Es fällt nicht unter die abschließende Liste in 14.8.2.4/9
A template type argument T, a template template argument TT or a template non-type argument i can be
deduced if P and A have one of the following forms:
T
cv-list T
T*
T&
T[integer-constant]
template-name<T> (where template-name refers to a class template)
type()(T)
T()()
T()(T)
T type::
type T::*
T T::*
T (type::)()
type (T::)()
type (type::)(T)
type (T::)(T)
T (type::)(T)
T (T::)()
T (T::*)(T)
type[i]
template-name<i> (where template-name refers to a class template)
TT<T>
TT<i>
TT<>
where (T) represents argument lists where at least one argument type contains a T, and () represents
argument lists where no parameter contains a T. Similarly, <T> represents template argument lists where
at least one argument contains a T, <i> represents template argument lists where at least one argument
contains an i and <> represents template argument lists where no argument contains a T or an i.