i'm guessing this is impossible, but is it possible to point to an operator's function, i would ideally like to pass it as an argument.
i would like to avoid having to pass a string literal to represent the operator and writing an if statement for each operator.
is there any way one could achieve something akin to:
there are probably errors in the above, it is meant only to illustrate the concept.Code:template<typename returnType,typename Arg>returnType func(Arg arg1,Arg arg2,operator op)
{
}
matrix a;
matrix b;
func(a,b,a.*);
it seems like there should be some way to create a function pointer to the operator, but i cannot get it...
it would be nice if it were possible to do this for POD also.