Michel Fortin Wrote:

> I recently had to use getopt. You use it like that:
> 
>       bool option;
>       int counter;
> 
>       getopt(args,
>               "option|o", &option,
>               "counter|c", &counter);
> 
> The problem is that taking addresses of a stack variable is disabled in 
> SafeD, which means getopt doesn't work in SafeD, which puts SafeD in a 
> strange position.

const opts = getopt(args);
const option = opts.get!bool("option|o");
const counter = opts.get!int("counter|c"); // also reusable

Reply via email to