I have a C++ class that is templatized like so:
template <typename Operator>
class MyClass;
Where Operator can also be templatized itself into:
template <typename Param1, typename Param2, typename Param3>
class MyOperator;
Now, when I try to write a templatized method for the class, MyClass, I get an error - this code:
template < template < typename Param1, typename Param2, typename Param3 > typename Operator >
void MyClass<Operator<Param1, Param2, Param3>>::FunctionName()
Produces the error: "undeclared identifier" for each of Param1, Param2, Param3 and Operator. Why would this be, since the typenames/classes are specified right above?
I know the example code doesn't make that much sense, but my ultimate goal is to partially specialize it to look something like:
template < template < typename Param1, typename Param2, typename Param3 > typename Operator >
void MyClass<Operator<Param1, "CustomParam", Param3>>::FunctionName()
So that if the second Param is "CustomParam", the function would execute a specific implementation. Would this work, even though I specify all the parameters as template parameters (since the parameter I want to specialize is the second parameter, but the first is not specialized)? Thanks!