template<int Degree> using curve = // some definition
template<int MaxDegree> using curve_variant = std::variant<curve<1>, curve<2>, .. curve<MaxDegree>>;
Run Code Online (Sandbox Code Playgroud)
In the above example, the number of parameters passed to std::variant's template would change depending on curve_variant's parameters:
For example, curve_variant<4> would resolve to std::variant<curve<1>, curve<2>, curve<3>, curve<4>>.
Since MaxDegree is known at compile time, this feels possible. But I also don't have a clue how to begin implementing this.