Thread overview
How to define struct with function pointer member ?
Jul 28, 2013
Gabi
Jul 28, 2013
Gabi
Jul 28, 2013
H. S. Teoh
Jul 28, 2013
Gabi
July 28, 2013
I tried:

struct X
{
..
function double(Individual) someFun;
..
}

But get:
Error: Declaration expected, not 'function'


Thanks,
Gabi
July 28, 2013
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
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
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 :)