On Thu, 08 Sep 2011 15:17:51 +0200, Steven Schveighoffer <[email protected]> wrote:

I wonder if there's a way to give the option of using a template parameter or using a positional parameter without having two different symbol names. hm...

openFile!(string modedefault = "r")(string filename, string mode = modedefault) if (isValidOpenMode(modedefault))
{
    if(!isValidOpenMode(mode))
       throw new Exception("invalid file open mode: " ~ mode);
    ...
}

Would that work?

Neat! And yes, it certainly does work. I'm still unsure when someone
will actually need to specify that at runtime, but maybe for scripting
languages?

--
  Simen

Reply via email to