class Foo { Foo opOpAssign(string op)(Foo b) if(op=="~=") { return this; } } void main() { Foo f = new Foo(); // Error: cannot append type test.Foo to type test.Foo f ~= new Foo(); }
Nevermind, I apparently can't read the docs right. This is how it's supposed to be, and it does work right: Foo opOpAssign(string op)(Foo b) if(op=="~")