discrimination of constructors with same number of parameters

spir denis.spir at gmail.com
Thu Dec 30 06:16:03 PST 2010


On Thu, 30 Dec 2010 08:04:29 -0500
sybrandy <sybrandy at gmail.com> wrote:

> Why not have something like this:
> 
> this (int[] data, string text, bool isMessage = false) {...}
> 
> Then, if you just pass in two parameters you treat it as a filename and 
> if you pass in a "true" for the third parameter, it's a message.  It's 
> not quite what you're looking for, but it's simple and pretty clean.
> 
> Casey

That's what I did, precisely, and yes the fake param is bool. (thought I had mentioned this in the OP, maybe forgot, sorry).

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list