const main args?

bearophile bearophileHUGS at lycos.com
Fri Aug 12 16:30:22 PDT 2011


Andrej Mitrovic:

> void main(string[] args)
> {
>     args.popFront;  // get rid of name
> 
>     foreach (arg; args)
>     {
>     }
> }

If I see code like that I probably rewrite it like this:

void main(in string[] args) {
    foreach (arg; args[1..$]) {
    }
}

;-)

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list