I have a class Basis
which is templated on another class DERIVED
via CRTP. This class has an inner class which operates as a functor and does the bulk of the work
template <typename DERIVED>
class Basis {
template <int M> // M is the degree of approximation
class Functor {
double operator()(Eigen::Matrix<double, M, 1> values) {
// Use specific function in DERIVED
...
}
};
...
};
So a specific class like Fourier
looks something like
class Fourier : public Basis<Fourier> { // use CRTP
...
};
Now I wish to alias a third class template <typename T> Worker
such as
template <typename BASIS, int M>
using Approx = Worker<typename BASIS::Functor<M> >;
so I can use it like
Approx<Fourier, 3>
but the aliasing gives me the error
error: template argument 1 is invalid
30 | Worker< typename BASIS::Functor<M> >;
| ^
Does anybody have an idea what the issue might be? The error message doesn't give more details, and using
template <int M>
using Approx = Worker<Fourier::Functor<M> >;
works fine.
I'm happy to give more details if needed.