I'm trying to define a new class template which has many parameters. For writing some methods (such as overloaded operators), I'd like to alias the template class type. Right now I'm doing it like this:
template <class T, int a, int b, int c, int d, int e, int f>
class ExampleClass {
using ExampleClassType = ExampleClass<T, a, b, c, d, e, f>;
// for example,
ExampleClassType operator+(const ExampleClassType& rhs) {
// ...
}
};
This approach seems redundant, since I'm writing out the list of template parameters twice. Is there a better way? I naively tried
using ExampleClassType = decltype(*this);
but this doesn't work, I think since this is not known at compile time.
Apologies if this is a duplicate question, I tried searching but found nothing about this specifically.