Normalize void

Yuxuan Shui yshuiv7 at gmail.com
Tue Jul 10 09:56:53 UTC 2018


On Tuesday, 10 July 2018 at 09:50:45 UTC, Yuxuan Shui wrote:
> Suppose I want to create a type to contain either a return 
> value or an error, I could probably do something like this:
>
> [...]

Possible alternatives:

* struct Void {}. Takes 1 byte, not as ideal
* alias Void = AliasSeq!(). Doesn't work as template argument. 
i.e.
       SomeTemplate!Void; // actually become SomeTemplate!()


More information about the Digitalmars-d mailing list