On 05/21/2015 12:44 PM, Meta wrote:

All we need is user-defined opIs and then we're really cooking with gas.

if (5 is between(4, 6))
{
     //...
}


We're almost there. :)

bool is_between(T0, T1, T2)(T0 what, T1 min, T2 max)
{
    return (what >= min) && (what <= max);
}

void main()
{
    if (5.is_between(4, 6)) {
        // ...
    }
}

Ali

Reply via email to