On Monday, 2 October 2023 at 19:28:32 UTC, BoQsc wrote:
On Monday, 2 October 2023 at 18:39:41 UTC, Imperatorn wrote:
On Monday, 2 October 2023 at 18:34:13 UTC, BoQsc wrote:
[...]

https://dlang.org/spec/operatoroverloading.html#binary


Overloading seems to only overload behaviour of existing operator, like:

```
+       -       *       /       %       ^^      &
|       ^       <<        >>        >>>    ~       in

```

I'm unable to see how the operator overloading would allow to define a new custom operator.

I guess I don't understand your confusion. % is the modulus operator, you can overload it if you want to instead do what you want according to your needs.

Reply via email to