Menu

#18 metaprogramming failure

open
nobody
None
5
2009-09-17
2009-09-17
Anonymous
No

Metaprogramming on "operator-" for example breaks things like

Vec3d vA, vB;
gmtl::length( vA - vB )

That produces the error:

no matching function for call to ‘length(gmtl::VecBase<float, 3u, gmtl::meta::VecBinaryExpr<gmtl::VecBase<float, 3u, gmtl::meta::DefaultVecTag>, gmtl::VecBase<float, 3u, gmtl::meta::DefaultVecTag>, gmtl::meta::VecMinusBinary> >)’

Instead it is required that we do:

Vec3d vA, vB;
gmtl::length( Vec3(vA - vB) )

Is there a way to do this better so that the former version would work?

Discussion


Log in to post a comment.