operator overloading outside the type
monkyyy
crazymonkyyy at gmail.com
Sat Oct 25 20:04:44 UTC 2025
On Saturday, 25 October 2025 at 12:52:34 UTC, Kapendev wrote:
> I'm not monkeyyyyy sadly, so can't really help that much.
```d
struct bar{
template opDispatch(string s){
template opDispatch(A...){
auto opDispatch(T...)(T){return bar();}
}
}
}
unittest{
auto foo=bar();
foo.helloworld!(3,bar)(13.37);
foo.AHHHHHH;
foo=foo+foo;//fails
}
```
opDispatch is special cased to break all attempts at opoverloading
More information about the Digitalmars-d
mailing list