What's wrong in this templatized operator overload ?

MobPassenger via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 21 20:18:24 PDT 2015


code:
---
struct Foo
{
     bool opIn_r(T)(T t){return false;}
}

static immutable Foo foo; // ouch
//static Foo foo; // OK

void main()
{
     assert("a" !in foo);
}


More information about the Digitalmars-d-learn mailing list