T
Taras_96
Hi all,
The FAQ at http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.19
writes that with the statement:
Foo x (Bar ())
that
"When the compiler sees Foo x(Bar()), it thinks that the Bar() part is
declaring a non-member function that returns a Bar object, so it
thinks you are declaring the existence of a function called x that
returns a Foo and that takes as a single parameter of type "non-member
function that takes nothing and returns a Bar." "
Is this the correct syntax for declaring a function that takes a
function parameter? I thought that the declaration required the
dereference operator:
Foo x( Bar (*) ());
Or is there a difference between a function parameter and a function
pointer parameter (I've never come across a function parameter, and
don't see how it would work).
Taras
The FAQ at http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.19
writes that with the statement:
Foo x (Bar ())
that
"When the compiler sees Foo x(Bar()), it thinks that the Bar() part is
declaring a non-member function that returns a Bar object, so it
thinks you are declaring the existence of a function called x that
returns a Foo and that takes as a single parameter of type "non-member
function that takes nothing and returns a Bar." "
Is this the correct syntax for declaring a function that takes a
function parameter? I thought that the declaration required the
dereference operator:
Foo x( Bar (*) ());
Or is there a difference between a function parameter and a function
pointer parameter (I've never come across a function parameter, and
don't see how it would work).
Taras