Topic: Nested class declaration after definition?
Author: "Ruslan Abdikeev" <ruslan_abdikeevRemoveIt@hotmail.com>
Date: Thu, 29 Mar 2001 20:04:13 CST Raw View
Just have seen something strange in standard:
3.4.4/3 - 3rd example:
struct Base {
struct Data; //OK: decalres nested Data
//...
struct Data { /*...*/ }; //Defines nested Data
struct Data; //SURPRISE: OK: Redeclares nested Data
};
I have reread "Class members" section and found that
9.2/1 - "... A member shall not be declared twice [...], except that a
nested class [...] can be declared and then later defined."
Did I miss something?
Sincerely,
Ruslan Abdikeev
Brainbench MVP for Visual C++
http://www.brainbench.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: Michiel Salters<Michiel.Salters@cmg.nl>
Date: Fri, 30 Mar 2001 19:27:40 GMT Raw View
In article <9a0mqq$pqn$1@news.wplus.spb.ru>, Ruslan Abdikeev says...
>
>Just have seen something strange in standard:
>
>3.4.4/3 - 3rd example:
>
>struct Base {
> struct Data; //OK: decalres nested Data
>//...
> struct Data { /*...*/ }; //Defines nested Data
> struct Data; //SURPRISE: OK: Redeclares nested Data
>};
You're not the first to note that. DR 85 is about the
last line. Proposed resolution is to remove it.
HTH,
--
Michiel Salters
Consultant Technical Software Engineering
CMG Trade, Transport & Industry
Michiel.Salters@cmg.nl
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: "William M. Miller" <wmmiller@MailAndNews.com>
Date: Fri, 30 Mar 2001 19:57:34 GMT Raw View
>===== Original Message From "Ruslan Abdikeev"
<ruslan_abdikeevRemoveIt@hotmail.com> =====
>Just have seen something strange in standard:
>
>3.4.4/3 - 3rd example:
>
>struct Base {
> struct Data; //OK: decalres nested Data
>//...
> struct Data { /*...*/ }; //Defines nested Data
> struct Data; //SURPRISE: OK: Redeclares nested Data
>};
>
>I have reread "Class members" section and found that
>
>9.2/1 - "... A member shall not be declared twice [...], except that a
>nested class [...] can be declared and then later defined."
>
>Did I miss something?
No, 3.4.4p3 is in error and will be corrected in the upcoming Technical
Corrigendum. See
http://www.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#85.
-- William M. Miller
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]