Thread overview | |||||
---|---|---|---|---|---|
|
November 10, 2010 2 bool optional params | ||||
---|---|---|---|---|
| ||||
Hello, Is there a way for a func to hold 2 optional params of the same type? void f(int p, bool b1=false, bool b2=false) { writefln("p=%s b1=%s b2=%s", p,b1,b2); } Or is there a workaroud? Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com |
November 10, 2010 Re: 2 bool optional params | ||||
---|---|---|---|---|
| ||||
Posted in reply to spir | On Wed, 10 Nov 2010 08:55:26 +0100, spir wrote:
> Hello,
>
> Is there a way for a func to hold 2 optional params of the same type?
> void f(int p, bool b1=false, bool b2=false) {
> writefln("p=%s b1=%s b2=%s", p,b1,b2);
> }
> Or is there a workaroud?
I'm not sure I understand what you're asking for here. Your example works for me.
-Lars
|
November 10, 2010 Re: 2 bool optional params | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars T. Kyllingstad | On Wed, 10 Nov 2010 08:54:20 +0000 (UTC)
"Lars T. Kyllingstad" <public@kyllingen.NOSPAMnet> wrote:
> On Wed, 10 Nov 2010 08:55:26 +0100, spir wrote:
>
> > Hello,
> >
> > Is there a way for a func to hold 2 optional params of the same type?
> > void f(int p, bool b1=false, bool b2=false) {
> > writefln("p=%s b1=%s b2=%s", p,b1,b2);
> > }
> > Or is there a workaroud?
>
> I'm not sure I understand what you're asking for here. Your example works for me.
See answer to Jonathan; I should have insisted on "optional".
Denis
-- -- -- -- -- -- --
vit esse estrany ☣
spir.wikidot.com
|
Copyright © 1999-2021 by the D Language Foundation