Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #481

Re: Typo in the Working Draft of the C++ Standard # 3337

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.albasani.net!.POSTED!not-for-mail
From Pete Becker<pete@versatilecoding.com>
Newsgroups comp.std.c++
Subject Re: Typo in the Working Draft of the C++ Standard # 3337
Date Wed, 18 Apr 2012 08:54:34 -0700 (PDT)
Organization Roundhouse Consulting, Ltd.
Lines 39
Sender std-cpp-request@vandevoorde.com
Approved stephen.clamage@oracle.com
Message-ID <2012041811243463815-pete@versatilecodingcom> (permalink)
References <6f6d535e-66de-42d1-adb6-639be3a67565@m18g2000vbl.googlegroups.com>
NNTP-Posting-Host nE4x/9iPpo98klhTYpIKUjjWgR6A8pgNdvOrkNpFqbw=
Content-Type text/plain; charset=utf-8; format=flowed
X-Trace news.albasani.net aO76NWPfBJ5FCWu5EdnCapptYzseiylNjp+TW3s6nuVvqjyb+rTiYUvPPn/11KxQEBEiLylk7oRqHGql+JKMBw==
X-Complaints-To abuse@albasani.net
NNTP-Posting-Date Wed, 18 Apr 2012 15:54:51 +0000 (UTC)
X-Mailer Perl5 Mail::Internet v2.05
X-Submission-Address std-cpp-submit@vandevoorde.com
Cancel-Lock sha1:bLEKeS739/65yikRiZD2OO9bZPk=
X-Original-Date Wed, 18 Apr 2012 11:24:34 -0400
Xref csiph.com comp.std.c++:481

Show key headers only | View raw


On 2012-04-18 06:11:23 +0000, Vlad from Moscow said:

>  I found a typo in the Working Draft of the C++ Standard #3337 in
>  paragraph #2 of the section 11.3 Friends. There is the following
>  example
>
>  [ Example:
>  class A {
>  class B { };
>  friend class X;
>  };
>  struct X : A::B { // OK: A::B accessible to friend
>  A::B mx; // OK: A::B accessible to member of friend
>  class Y {
>  A::B my; // OK: A::B accessible to nested member of friend
>  };
>  };
>  —end example ]
>
>  It is obvious that instaed of struct X : A::B shall be class X : A::B
>  because the friend declaration of X uses specifier class.
>  Maybe this typo is present in the C++ Standard. It should be checked.

It's the same in the standard. Probably should be changed, for clarity.
But my recollection is (I haven't looked it up) that struct, class, and
even union can be used interchangeably in a forward declaration; it's
only at the point of definition that the keyword matters.

-- 
  Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)


[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Typo in the Working Draft of the C++ Standard # 3337 Vlad from Moscow <vlad.moscow@mail.ru> - 2012-04-17 23:11 -0700
  Re: Typo in the Working Draft of the C++ Standard # 3337 Pete Becker<pete@versatilecoding.com> - 2012-04-18 08:54 -0700
    Re: Typo in the Working Draft of the C++ Standard # 3337 Daniel Krügler<daniel.kruegler@googlemail.com> - 2012-04-19 11:08 -0700
    Re: Typo in the Working Draft of the C++ Standard # 3337 Vlad from Moscow<vlad.moscow@mail.ru> - 2012-04-19 11:08 -0700

csiph-web