Postfix type notation - readability and parsing?

Paul Backus snarwin at gmail.com
Wed Mar 6 17:27:55 UTC 2019


On Wednesday, 6 March 2019 at 07:53:42 UTC, Simen Kjærås wrote:
> Just to add a 6) to the mix:
>
> alias port = Option!(immutable ushort, "p|port", "Sets the port 
> used for serving.", "PORT", 8888);
>
> static this() {
>     port = 1234;
> }

Option!(...) is a type, not a value, so this should actually be 
written as:

alias PortOption = Option!(...);
PortOption port;

static this() {
     port = 1234;
}


More information about the Digitalmars-d mailing list