From: Daniel Krügler on
On 2 Feb., 21:23, pion <vahan...(a)poczta.onet.pl> wrote:
> Can anyone answer if this is a valid C++ syntax - look at constructors
> ended with comma - not semicolon:
>
> class Test {
> public:
> Test(),
> Test(int a),
> ~Test();
> int getA() const;
> private:
> int a;
>
> };
>
> Full test code here:http://ideone.com/NT4DL588

This question occurs once in a while, which
is understandable, because the code looks
rather odd ;-) [And I never have seen such
code in a productive environment]

Nevertheless it is valid C++, because we meet
here the grammar element /member-declarator-list/,
which is defined to be

member-declarator-list:
member-declarator
member-declarator-list , member-declarator

where member-declarator corresponds to special
declarators and member-declarator-list is one
valid part of a member-declaration (for details
see the standard).

HTH & Greetings from Bremen,

Daniel Kr�gler


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]