mercredi 2 août 2017

Compile time polynoms

I (finally) recently heard about variadic templates. I'd like to know that if there is a way to make a int - polynomial with compile time operators:

template <int... coefs> 
struct polynom {}

Which coud support add, unary minus and mul operators.

My understanding is that is not possible, because of constraints on operators, and the fact that polynom<1,2> is a different type from polynom<2,1>

Does someone here have experience about that?

Aucun commentaire:

Enregistrer un commentaire