ring Op, T )( T v ) if( isNumeric!T )
{
return Expr!( OpBinary!( Op, R, Constant!( T, v ) ) )();
}
auto opBinaryRight( string Op, T )( T v ) if( isNumeric!T )
{
return Expr!( OpBinary!( Op, Constant!( T, v ), R ) )();
}
};
But I cannot figure out how to implement expression
I have been trying to create some simple expression templates in D1 but I've
run into trouble. Here is a reduced test case:
class A
{
void opSub_r(T:int)(T a)
{
}
void opSub(T)(T a)
{
}
}
void main(char[][] args)
{
A a;
a - 1;
Mr enuhtac:
> But these workarounds are ugly, if would greatly prefer the normal comparison
> operators.
> Does anyone has an idea how to use them?
I don't know the answer. If no one will give you a good answer then I suggest
you to ask the same question (with the same code example) in the main
meric!T )
{
return Expr!( OpBinary!( Op, R, Constant!( T, v ) ) )();
}
auto opBinaryRight( string Op, T )( T v ) if( isNumeric!T )
{
return Expr!( OpBinary!( Op, Constant!( T, v ), R ) )();
}
};
But I cannot figure out how to implement expression templates for comparis