Re: Getopt default int init and zero

2017-05-20 Thread Jon Degenhardt via Digitalmars-d-learn
On Friday, 19 May 2017 at 12:09:38 UTC, Suliman wrote: I would like to check if user specified `0` as getopt parameter. But the problem that `int`'s are default in `0`. So if user did not specified nothing `int x` will be zero, and all other code will work as if it's zero. One way to do this

Re: Getopt default int init and zero

2017-05-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 19, 2017 12:09:38 PM PDT Suliman via Digitalmars-d-learn wrote: > I would like to check if user specified `0` as getopt parameter. > But the problem that `int`'s are default in `0`. So if user did > not specified nothing `int x` will be zero, and all other code > will work as if

Getopt default int init and zero

2017-05-19 Thread Suliman via Digitalmars-d-learn
I would like to check if user specified `0` as getopt parameter. But the problem that `int`'s are default in `0`. So if user did not specified nothing `int x` will be zero, and all other code will work as if it's zero. In std.typecons I found Nullable that allow init int to zero. I tried to