out default argument of void

Simen Kjærås simen.kjaras at gmail.com
Wed Jan 4 15:02:20 PST 2012


On Wed, 04 Jan 2012 23:40:28 +0100, Jesse Phillips  
<Jessekphillips+D at gmail.com> wrote:

> On Wednesday, 4 January 2012 at 22:19:28 UTC, Caligo wrote:
>> 1. Are there any other solutions ?
>> 2. Would it make sense to have 'out default argument of void' in D?
>
> Out parameters are initialized. The declaration you want is:
>
> bool fun(double theta, A a = A.init, B b = B.init, C c = C.init){ /* ...  
> */ }

No. ref A a, perhaps, but that again precludes the use of A.init as
default value.


More information about the Digitalmars-d-learn mailing list