Passing Command Line Arguments to a new Thread

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 7 11:53:00 PDT 2014


On Thursday, 7 August 2014 at 18:38:37 UTC, Marc Schütz wrote:
> But this shouldn't be necessary, right? It's a mutable slice to 
> immutable data, but the slice is passed by value, so no mutable 
> sharing takes place.

I agree.

I'll use .idup anyhow. For this work I however have to do

void otherMain(immutable string[] args)
{
      useArgs(args.dup);
}

as my function useArgs has signature

useArgs(string[] args)

Seems awkward.


More information about the Digitalmars-d-learn mailing list