220 7700 <7a8d898e-1884-49f7-b0c8-52af0813e6c4@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: fmatthew5876@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Fixing the private method issue
Date: Mon, 11 Nov 2013 19:58:46 -0800 (PST)
Lines: 94
Approved: news@gmane.org
Message-ID: <7a8d898e-1884-49f7-b0c8-52af0813e6c4@isocpp.org>
References: <527a6d7d.ea42420a.1057.ffffdaad@mx.google.com>
 <CAA7U3HNPAhAmRXFv5H9Dz0eHf36oDPOcXHnNkntqQRnZFC+aHA@mail.gmail.com>
 <CAPBZbvwDTinn3N_WWw7Mr7DWVzSbigL-WnC2XpGuQQbtp7faQw@mail.gmail.com> <CAA7U3HP6pSkVaV0wc0rsRUFv9BbbVsPSfohCwyHTHsUc=VHgow@mail.gmail.com>
 <CAPBZbvzckSiY=hBJTKk4zBTQfpU4op4OGJ9FmYp-m4nL-7FaSw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_2832_23477592.1384228726952"
X-Trace: ger.gmane.org 1384228726 10193 80.91.229.3 (12 Nov 2013 03:58:46 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 12 Nov 2013 03:58:46 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELF54RTIGRB56OQ2KAKGQE3FT2MRY@isocpp.org Tue Nov 12 04:58:50 2013
Return-path: <std-proposals+bncBDELF54RTIGRB56OQ2KAKGQE3FT2MRY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f198.google.com ([209.85.214.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELF54RTIGRB56OQ2KAKGQE3FT2MRY@isocpp.org>)
	id 1Vg57p-0008SN-K4
	for gclcip-std-proposals@m.gmane.org; Tue, 12 Nov 2013 04:58:49 +0100
Original-Received: by mail-ob0-f198.google.com with SMTP id gq1sf16914684obb.5
        for <gclcip-std-proposals@m.gmane.org>; Mon, 11 Nov 2013 19:58:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=oaSwapq5WgmwqNfpdyoUAcMnHvxKe7SRYrRYxvs7UaI=;
        b=Ltkz+q5dxm1e4NoLcLQxD4DUCOgm2Z8uMJI+qjVMpCVDVf2qPcd94W7MkmymZyTAq2
         HnpSkVDyrZKPT0U3Tt31BHQA9TBQ8g7pSjLG9AvouNKPBr1J5ijsMnW5Vvib+tCwU35F
         WpfU0ZXF+MM2JQQm+fFoz01OPpogaiLIcuops3GeZYxGgtY+8H479viKS34Bw7owpwRN
         A75gHSxCOCZICgPW81+kt4ZDittvZHhZAzJensLhV83hL6t19QaUxqqvkEGrC+pHAavQ
         QunQ4fEcn93TZCzkjAWYIw/rTWYXOopx66ygNr8A9yZEnQGnh+AUYtSCpaZAUlQsCxA7
         5ylw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=oaSwapq5WgmwqNfpdyoUAcMnHvxKe7SRYrRYxvs7UaI=;
        b=IJgWfzcTiU9U4U1CkOfas1aaDrRgH6KByZPjsoA5te8RnzILD2GgSHvWyAUeP8N0hr
         vIm5Ucb4RbyhEPCt6SgeS2SyPiSxv5SavKuJK5WGrsem2xBPhS9/EtCJCcRv8CGZNL7z
         XJxRKkB8FAf8DT0kvuJNnJOfAwWj9OWMVj+UDNcHZgoGESz1n0ueGLIGzYvodRfRtaDZ
         //oAMxqV2Ipzwij9gC+x97uONHHvM686PvjMPcg9ItQAchak+IV2LqAqZLJqD/fZgbXs
         GrMc0U8WxE/L0iBAusnMqm3Pj3Uh92res6J06HGOy6/NORhNLDSGQJKfWtJKCUy7kn6n
         3CyA==
X-Gm-Message-State: ALoCoQmetT4APtprBdlTVEBtWgvnQLetkyjUsEpaQ1QCQU4g7cHc6hpcM8Rnwif/Z+dFUZ9Up46z
X-Received: by 10.50.79.201 with SMTP id l9mr7037879igx.4.1384228728091;
        Mon, 11 Nov 2013 19:58:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.24.132 with SMTP id u4ls1599621obf.40.gmail; Mon, 11 Nov
 2013 19:58:47 -0800 (PST)
X-Received: by 10.182.81.41 with SMTP id w9mr374obx.32.1384228727594;
        Mon, 11 Nov 2013 19:58:47 -0800 (PST)
In-Reply-To: <CAPBZbvzckSiY=hBJTKk4zBTQfpU4op4OGJ9FmYp-m4nL-7FaSw@mail.gmail.com>
X-Original-Sender: fmatthew5876@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7700
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7700>

------=_Part_2832_23477592.1384228726952
Content-Type: text/plain; charset=ISO-8859-1

I think I prefer my idea of being able to just define private methods 
outside of the class body, explicit keyword or not.

//foo.hh
class Foo {
public:
  int foo();
};

//private extension method declaration in the header file
explicit int Foo::_bar();

//inline private extension method
explicit inline int Foo::_baz() { return 5; }

//inline public method calls private extension method
inline int Foo::foo() { return _bar; }

//foo.cc
//private extension method which only appears in the file.
explicit int Foo::_bar_impl() {
  return 42;
}

//private extension method definition
explicit int Foo::_bar() {
  return _baz_impl();
}

With the namespace proposal, you get to define extra things like nested 
classes and typedefs, but is there any reason you would actually ever need 
to do this? The only time I find myself defining private nest classes or 
typedefs is when I'm using them to define my private class data members. In 
those situations, they would have to be in the class definition anyway.

If you want to define helper classes and typedefs, you can simply make them 
file local which is even better, or if they need to be shared between 
translation units, use a private header file.


-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_2832_23477592.1384228726952
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I think I prefer my idea of being able to just define priv=
ate methods outside of the class body, explicit keyword or not.<div><br></d=
iv><div>//foo.hh</div><div>class Foo {</div><div>public:</div><div>&nbsp; i=
nt foo();<br>};</div><div><br></div><div>//private extension method declara=
tion in the header file</div><div>explicit int Foo::_bar();</div><div><br><=
/div><div>//inline private extension method</div><div>explicit inline int F=
oo::_baz() { return 5; }</div><div><br></div><div>//inline public method ca=
lls private extension method</div><div>inline int Foo::foo() { return _bar;=
 }</div><div><br></div><div>//foo.cc</div><div>//private extension method w=
hich only appears in the file.</div><div>explicit int Foo::_bar_impl() {</d=
iv><div>&nbsp; return 42;</div><div>}<br><div><br></div><div>//private exte=
nsion method definition</div><div>explicit int Foo::_bar() {</div><div>&nbs=
p; return _baz_impl();</div><div>}</div><div><br></div><div>With the namesp=
ace proposal, you get to define extra things like nested classes and typede=
fs, but is there any reason you would actually ever need to do this? The on=
ly time I find myself defining private nest classes or typedefs is when I'm=
 using them to define my private class data members. In those situations, t=
hey would have to be in the class definition anyway.</div><div><br></div><d=
iv>If you want to define helper classes and typedefs, you can simply make t=
hem file local which is even better, or if they need to be shared between t=
ranslation units, use a private header file.</div><div><br></div><div><br><=
/div></div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2832_23477592.1384228726952--

.
