On Wednesday, 10 August 2016 at 12:36:14 UTC, Arafel wrote:
Hi,

I'm trying to check at compilation time if a given type implements some operator (let's assume it's '+' in this case), without caring about the type of the parameters it accepts. Since operator overloading is expressed in D through templated functions, what is the preferred way of checking if a template is / can be instantiated with a given parameter list?

[...]

static assert(is(typeof(S()+42)));
static assert(!is(typeof(S()-42)));

Reply via email to