From 2429824657459510478 X-Google-Thread: f78e5,13848293b54382c8 X-Google-Attributes: gidf78e5,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Apr 2006 23:00:14 -0500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on ak74.algebra.com X-Spam-Level: **** X-Spam-Status: No, score=4.9 required=5.0 tests=FORGED_YAHOO_RCVD,HEADER_SPAM, MISSING_HEADERS,NO_REAL_NAME,TO_CC_NONE autolearn=disabled version=3.1.1 X-Authentication-Warning: mulga.cs.mu.OZ.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 Delivered-To: std-c++@ucar.edu From: johnchx2@yahoo.com Newsgroups: comp.std.c++ Subject: Re: Encapsulation of variables Organization: http://groups.google.com Message-ID: <1145384053.409127.326590@g10g2000cwb.googlegroups.com> References: <1145365947.835536.81010@u72g2000cwu.googlegroups.com> 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.2) Gecko/20060308 Firefox/1.5.0.2,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g10g2000cwb.googlegroups.com; posting-host=207.202.132.38; posting-account=1HxwpAwAAABlK5OZfZYCg5RQRtKiYFfE X-Virus-Scanned: amavisd-new at ucar.edu X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU Approved: Fergus Henderson , moderator of comp.std.c++ X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU Date: Tue, 18 Apr 2006 22:56:16 CST Lines: 30 NNTP-Posting-Host: 65.182.171.162 X-Trace: sv3-14yzyjUNUbtaY3777FWxlPadR2CEl5DR7c5iYyGNrjyQRkw5MCS8ZYf+NDkrBNv/WuPml+OUsdFVIJe!cZWim8fnJ3njh8EIoh/RrO+aUClZVG5M4mgZzedtmoionHzq2lVv2c4GTTzo65LfWnXnCCo/wuh1!bk99G6rWiLqveXsRIKvk97vHebhRvU0iyISFo5ew7po= 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: g2news1.google.com comp.std.c++:1606 philparsonage@hotmail.com wrote: > class A { > private: int _fred; /// no-one can see fred directly > }; > > class B : public A { > public : using A::_fred; /// but this magically turns A::_fred to be > public! > } > > int main(int argc, char** argv) > { > B b; > b._fred = 10; // you can do this > return 0; > } > > Is this really part of the standard? No, the using declaration in B should not compile, since B has no access to private members of A. It would be legal if _fred were protected rather than private, of course. --- [ 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 ]