Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 28, 2013 How to define struct with function pointer member ? | ||||
---|---|---|---|---|
| ||||
I tried: struct X { .. function double(Individual) someFun; .. } But get: Error: Declaration expected, not 'function' Thanks, Gabi |
July 28, 2013 Re: How to define struct with function pointer member ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gabi | On Sunday, 28 July 2013 at 22:04:57 UTC, Gabi wrote:
> I tried:
>
> struct X
> {
> ..
> function double(Individual) someFun;
> ..
> }
>
> But get:
> Error: Declaration expected, not 'function'
>
>
> Thanks,
> Gabi
Sorry I found the answer.
Should have declared double function(...) someFun;
|
July 28, 2013 Re: How to define struct with function pointer member ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gabi | On Mon, Jul 29, 2013 at 12:04:55AM +0200, Gabi wrote: > I tried: > > struct X > { > .. > function double(Individual) someFun; [...] The correct syntax is: double function(Individual) someFun; T -- Music critic: "That's an imitation fugue!" |
July 28, 2013 Re: How to define struct with function pointer member ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Sunday, 28 July 2013 at 22:13:13 UTC, H. S. Teoh wrote:
> On Mon, Jul 29, 2013 at 12:04:55AM +0200, Gabi wrote:
>> I tried:
>>
>> struct X
>> {
>> ..
>> function double(Individual) someFun;
> [...]
>
> The correct syntax is:
>
> double function(Individual) someFun;
>
>
> T
Yes thanks. Beginner's mistake :)
|
Copyright © 1999-2021 by the D Language Foundation