there is a bunch of operator*
maybe they can be replaced with somethink like:
template <typename T, typename DATA_TYPE, unsigned
ROWS, unsigned COLS>
inline T operator*( const Matrix<DATA_TYPE, ROWS,
COLS>& matrix, const T& in)
{
T temporary;
return xform( temporary, matrix, in);
}
or even:
template <typename T, typename M>
inline T operator*( const M& matrix, const T& in )
{
T temporary;
return xform( temporary, matrix, in );
}
I think that this is worth pursuing, but it will not be as simple as what you have proposed. The issue is that there are overloads of operator* where a fundamental type is passed as an argument (such as scalar multiplication of a vector). Perhaps the solution is to make gmtl::xform() more general first so that all operator* uses end up getting handed off to an overload of gmtl::xform(). That is the first thing that comes to mind anyway.