|
Boost : |
From: Edward Diener (eddielee_at_[hidden])
Date: 2002-08-26 10:07:19
"Douglas Gregor" <gregod_at_[hidden]> wrote in message
news:200208252251.18917.gregod_at_cs.rpi.edu...
> On Sunday 25 August 2002 12:15 pm, Edward Diener wrote:
> > I always though that "int (int,int)" was not a valid type while "int
> > (*)(int,int)" was a valid type. Are they equivalent to each other ? If
so,
> > is this the way C++ has been for awhile or is it new to the official
1998
> > C++ standard ?
>
> They are not equivalent. The former is a function type and the latter is a
> pointer to a function type. Function types aren't used very often in C++
> (actually, I've never needed them before this), and they even have some
weird
> behavior. For instance:
>
> void foo(int (int, int));
>
> is equivalent to
>
> void foo(int (*)(int, int));
>
> because parameters with function type are adjusted to parameters with type
> pointer-to-function.
Perhaps this is off-topic for Boost ( and belongs in comp.lang.c++ ) but
what is the syntax for using a "function type" to declare or define a
function ? If there is none, what usage does a "function type" have that is
different from a "pointer to function type".
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk