Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-12 18:59:21


On Sun, 12 Jan 2003 22:38:06 +0100, Terje Slettebø
<tslettebo_at_[hidden]> wrote:

>>From: "Paul Mensonides" <pmenso57_at_[hidden]>
>> In other words, the "void" parameter list is fundamentally different than
>> "type void".
>
>It appears this is right. 8.3.5/2 says: "[...] If the
>parameter-declaration-clause is empty, the function takes no arguments. The
>parameter list (void) is equivalent to the empty parameter list.

Ok. But the point is not whether it is equivalent to the empty
parameter list or not but whether it is legal to have a type-id (of
type void) instead of the keyword 'void'. By grammar that's already
allowed, but of course this is not enough. Personally I don't think
the standard is clear about this, though the response to DR18 says so:

  http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#18

In some old newsgroup post, searched through Google a while ago, I
also read that the committee rejected a proposal to allow the
generalized form f(T) with T=void, but I've never read the proposal
itself (I didn't find it at that time). Maybe Dave can do something to
raise the dead though ;-)

>Except for
>this special case, void shall not be a parameter type (though types derived
>from void, such as void*, can)."

Er... don't remind me this sentence. It seems to say that in

    f(void);

void is a parameter type :-( In effect, if one says so then Dave's
code could be legal, because formally it has exactly one parameter of
type void. But then, such a parameter would be an inexistent local
variable of incomplete and incompletable type, not something that one
would desire, from a logical perspective, either ;-) Fortunately it's
not necessary to go into such logical and linguistic contortions to
clarify the situation in one direction or the other.

Genny.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk