From 6465068467269820534
X-Google-Thread: f78e5,51456c3eb8f9490e
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 17 Aug 2006 15:40:14 -0500
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
From: "mark" <markw65@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Copy Constructor Confusion!
Organization: http://groups.google.com
Message-ID: <1155845943.564948.233640@75g2000cwc.googlegroups.com>
References: <1155645873.296811.3890@74g2000cwt.googlegroups.com>
   <hPkEg.12700$j7.324766@news.indigo.ie>
   <ebsor6$jbq$1@news.datemas.de>
   <1155663179.843769.44420@b28g2000cwb.googlegroups.com>
   <4kh3o8Fc528lU1@individual.net>
   <1155753523.459377.147180@m79g2000cwm.googlegroups.com>
   <4kjo9uFcihf4U1@individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: 75g2000cwc.googlegroups.com; posting-host=207.135.74.34;
   posting-account=kmJZpwwAAADTaEqNJ8z_rfhCwbaAxYpY
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Date: Thu, 17 Aug 2006 15:31:51 CST
Lines: 39
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-UdatVw0Ve5Tb2wUmTOkr0fxyMC3ARwIEoLCBiH7JbfivQh54e09Widt4gJqdGUgbZoWLNpOm2qEeuOy!zvPxHWbUIhbt8BPI+3PKtnmLwzCU0V3bHNrLa8nHr0aH9hC9pLJk0oF8hFmZMrPjxTQNFakf4Nw5!z5F0d7Z2I0z4lYJH0+ueaZe25PCGpMUJe8DDGDZ77g==
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news2.google.com comp.std.c++:3326


"Matthias Hofmann" wrote:
> "mark" <markw65@gmail.com> schrieb im Newsbeitrag
> news:1155753523.459377.147180@m79g2000cwm.googlegroups.com...
>
> >> >> If it appears inside a member of a derived class, "protected" should
> >> >> suffice.
> >> >
> >> > Really?
> >>
> >> Yes, see section 11/1: "A member of a class can be [...] protected; that
> >> is,
> >> its name can be used only by members and friends of the class in which it
> >> is
> >> declared, and by members and friends of classes derived from this class."
> >
> > You left off the important part of the sentence (see 11.5), which says:
> >
> > . Except when forming a pointer to member (5.3.1), the access must be
> > through a pointer to, reference to, or object of the derived class
> > iteself (or any class derived from that class) (5.2.5).
>
> Yes, that's true. A protected member can be accessed only if those
> conditions you mentioned are also met.

And since they can never be met for the snippet in question ("X x =
X();", if you remember), the statement 'If it appears inside a member
of a derived class, "protected" should suffice.' is in fact false.

Mark Williams

Mark Williams

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



