Operator Overloading for Enum

DolphinChips td2505052 at gmail.com
Mon Feb 8 16:10:46 UTC 2021


On Monday, 8 February 2021 at 15:56:24 UTC, Michael Brown wrote:
> Hi all,
>
> Is it possible to operator overload on enums? I'd like to do a 
> opCmp()
>
> Kind regards,
> Mike

You can create custom struct type with opCmp() and create enum 
with that type. Example: https://run.dlang.io/is/m7DN66


More information about the Digitalmars-d-learn mailing list