
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote in message news:d0qot3
Can you provide some background information ? Example one: same old class Matrix { Matrix(LAZY_OP((Matrix_ + Matrix_ ) * Matrix_)); Matrix(LAZY_OP(Matrix_ * ( Matrix_ + Matrix_))); }; //.. Matrix a, b, c, d, e; e = (a + b) * (c + d); //What to choose: first or second? //I mean //First: //Matrix t = c + d; //e = (a + b) * t; //Second: //Matrix t = a + b; //e = t * (c + d); //My idea is to add unique number to each n-arity operator //(some kinda weight of operator), and choose the n-arity operator //with maximum value. //So I really need that max_possible_N_of_all_B_specializations<T>::value.
Example two: same old class Matrix { Matrix(LAZY_OP((Matrix_ + Matrix_) * (Matrix_ + Matrix_))); Matrix(LAZY_OP(Matrix_ * (Matrix_ + Matrix_ * Matrix_)))); }; //.. Matrix a, b, c, d, e, f; f = (a + b) * (c + d * e); //Again: First or Second? -- Pavel Chikulaev