Re: out default argument of void

2012-01-04 Thread Timon Gehr
){return funImpl(theta,a,b,c); bool fun(double theta){return funImpl(theta);} 2. Would it make sense to have 'out default argument of void' in D? void initializer means uninitialized. I don't think that can do what you want.

Re: out default argument of void

2012-01-04 Thread Ali Çehreli
On 01/04/2012 02:19 PM, Caligo wrote: I have a function that looks something like this: bool fun(double theta, out A a, out B b, out C c){ /* ... */ } if fun() returns false, then nothing is supposed to be assigned to a, b, c. If it returns true, then values are assigned to a, b, c.

Re: out default argument of void

2012-01-04 Thread Caligo
On Wed, Jan 4, 2012 at 4:40 PM, Jesse Phillips jessekphillip...@gmail.com wrote: 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){ /* ... */ } In my case A, B, and C are structs, so that works the way I wanted it.

Re: out default argument of void

2012-01-04 Thread Jesse Phillips
On Wednesday, 4 January 2012 at 23:02:24 UTC, Simen Kjærås wrote: On Wed, 04 Jan 2012 23:40:28 +0100, Jesse Phillips jessekphillip...@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