digitalmars.D.learn - can I overload operators as extension methods?
- XavierAP (5/5) Mar 09 2017 The same way as T.foo() is lowered to foo(T) if no such member is
- Adam D. Ruppe (4/6) Mar 09 2017 No.
The same way as T.foo() is lowered to foo(T) if no such member is defined inside the type. It would allow me to extend 3rd party types with operator notation without wrapping them. After trying and reading the specification, looks like nuts, but just wanted to confirm. Thx
Mar 09 2017
On Thursday, 9 March 2017 at 23:50:04 UTC, XavierAP wrote:The same way as T.foo() is lowered to foo(T) if no such member is defined inside the type.No. But wrapping in a struct with alias this lets you extend them pretty easily too.
Mar 09 2017