Named constructors

Salih Dincer salihdb at hotmail.com
Mon Nov 25 06:00:49 UTC 2024


On Saturday, 9 November 2024 at 00:02:52 UTC, JN wrote:
> ...
> Won't work, because you can't have two constructors with same 
> args. Of course you can work it around by e.g. wrapping them in 
> some "Degree" and "Radian" struct so that they're separate type 
> and overloads.
> ...

See also the example in https://dlang.org/phobos/std_sumtype.html

SDB at 79


More information about the dip.ideas mailing list