Operator Overloading - Only for Classes and Structs?

matheus matheus at gmail.com
Mon Jun 23 19:00:34 UTC 2025


On Monday, 23 June 2025 at 15:27:46 UTC, Nick Treleaven wrote:
> ...
> One reason is that it would be hard to reason about what the 
> operator means - for example if there is one operator overload 
> in module `a` and another one in `b`, that have compatible 
> operand types, and both imports are used in the same project 
> for different modules.
> ...

I haven't thought about that in fact. That another thing with 
what Jonathan said which makes a lot of sense.

In fact this restriction is good in fact.

Thanks,

Matheus.


More information about the Digitalmars-d-learn mailing list