hasBasicMathOp

template hasBasicMathOp (
T
) {}

Members

Manifest constants

hasBasicMathOp
enum hasBasicMathOp;
Undocumented in source.

Examples

static assert( !hasBasicMathOp!int );
static assert(  hasBasicMathOp!float );
static assert(  hasBasicMathOp!double );
static assert(  hasBasicMathOp!real );
static assert(  hasBasicMathOp!cfloat );
static assert( !hasBasicMathOp!char );
static assert( !hasBasicMathOp!string );

struct TTest
{
    float x,y;
    auto opBinary(string op)( in TTest v ) const 
        if( op=="+" || op=="-" )
    { return TTest(x+v.x,y+v.y); }
    auto opBinary(string op)( double v ) const 
        if( op=="*" || op=="/" )
    { return TTest(x*v,y*v); }
}

static assert(  hasBasicMathOp!TTest );

struct FTest
{
    float x,y;
    auto opAdd( in TTest v ) const { return TTest(x+v.x,y+v.y); }
}

static assert( !hasBasicMathOp!FTest );

Meta