220 24843 <CAA7YVg0wQ5Fc0MLP0no6tPip+pexrQvtsb0+US_tRfFJ+9DQDg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Viacheslav Usov <via.usov@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Partial class: a separation of a class interface
 from its implementation with no memory costs
Date: Mon, 29 Feb 2016 19:52:18 +0100
Lines: 102
Approved: news@gmane.org
Message-ID: <CAA7YVg0wQ5Fc0MLP0no6tPip+pexrQvtsb0+US_tRfFJ+9DQDg@mail.gmail.com>
References: <374600f5-0397-4243-91bc-d01afd145e6c@isocpp.org>
	<CAA7YVg3MdwT2yEMuDmrkQPyOuUaPC6LeY+8zvvWJfYvkAejxbA@mail.gmail.com>
	<a01958c0-8cfe-457a-a34a-e9a280b8600a@isocpp.org>
	<CAA7YVg3vRFHA0sPtoJgXEOSMXxfSOBD6Ac-ZLT2Xb5vUUspHVQ@mail.gmail.com>
	<59566830-e0fd-4730-9416-bc427c249c48@isocpp.org>
	<CAA7YVg3AOmiDXtY58AosYG=Qhq9K8J0q+jjdgLEi1P0Bph6r+Q@mail.gmail.com>
	<71766f85-7330-4387-8485-642e3f3ad003@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a113d38ceee6755052ced25a9
X-Trace: ger.gmane.org 1456771945 22248 80.91.229.3 (29 Feb 2016 18:52:25 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 29 Feb 2016 18:52:25 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDU6VRPKW4BBBY5G2K3AKGQEBS4VPMY@isocpp.org Mon Feb 29 19:52:22 2016
Return-path: <std-proposals+bncBDU6VRPKW4BBBY5G2K3AKGQEBS4VPMY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDU6VRPKW4BBBY5G2K3AKGQEBS4VPMY@isocpp.org>)
	id 1aaSvd-0001OD-9r
	for gclcip-std-proposals@m.gmane.org; Mon, 29 Feb 2016 19:52:21 +0100
Original-Received: by mail-pf0-f197.google.com with SMTP id 124sf167796617pfg.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 29 Feb 2016 10:52:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=ArqSO62eJMQZCLdGv43QX58LTIPsbeZzAQnWOHqha3w=;
        b=IcZS2a0puRSZmw9jhorUiGZwqa14qyNYt/oyPznKqSsgi55yqUuq0KfTpuwFricKvg
         SGUeWLtHtBrdkCkD3NzZwh0GNApQT2VgEbPFSkQ7xAFFftShikfwA4Cx1Y+cNJ/AYjtQ
         F/Fv1ShwCsfa8jYkkf/opgVkmwzxuaR/neuoRaY+DKOaeXQTtjNWoXOSdLmK4/3zn1eu
         gxiUJ7W3GBNiMW4kzffL777HsBxv4ZHSCzroIz6wwx5aFSzlu0l/n4a4CCpKHIAuu90r
         JAqHiMFrv36SQtqgkRQSKCkCe+wC4QbNyBGRBAF/uI+02mCoSUAwEkb/yAzlSmYWoCEK
         D40Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ArqSO62eJMQZCLdGv43QX58LTIPsbeZzAQnWOHqha3w=;
        b=dve85XAXQringhIC0FDThSUTIBFwGcAzSQ/GQ0P37XSccO3uteDX1w5k5vTecaild0
         DNqrmpeZ/15SrdNGrR6Qo9rjOiwSkDbbBrH4vkQ0hD7Lsr4m+11khZ3BB8rn6WSKKrqK
         vKjGfWu02uyLSB4YIg65SpC2pOlqwZKLWxvMmwLY3zSWhHxaRenUjx3Lg5kis+cTkOoG
         kO7y4xZHudpGhe9vkymNkD7wxGqRs3NIZgJE5QCHfFCsQzMoYCOXNrovyGF75ZBh35pR
         7eh3PZumZzcklyCislV4WEMQKVN7dWXRdLV78nQadIionIU8/VTctMXjM9NalwLAuZ7d
         96Vw==
X-Gm-Message-State: AD7BkJIuaKgXSCLd80r1EFquilgtAJ+yx0SgkYWHcXRw9ewZc4NUrrblhvNGYMsJeaad/w==
X-Received: by 10.66.216.100 with SMTP id op4mr14621952pac.9.1456771940233;
        Mon, 29 Feb 2016 10:52:20 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.245.202 with SMTP id xq10ls1186402obc.17.gmail; Mon, 29
 Feb 2016 10:52:19 -0800 (PST)
X-Received: by 10.202.69.196 with SMTP id s187mr12566770oia.89.1456771939077;
        Mon, 29 Feb 2016 10:52:19 -0800 (PST)
Original-Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com. [2607:f8b0:4003:c06::235])
        by mx.google.com with ESMTPS id o128si22577906oif.112.2016.02.29.10.52.19
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 29 Feb 2016 10:52:19 -0800 (PST)
Received-SPF: pass (google.com: domain of via.usov@gmail.com designates 2607:f8b0:4003:c06::235 as permitted sender) client-ip=2607:f8b0:4003:c06::235;
Original-Received: by mail-oi0-x235.google.com with SMTP id c203so19256532oia.2
        for <std-proposals@isocpp.org>; Mon, 29 Feb 2016 10:52:19 -0800 (PST)
X-Received: by 10.202.223.84 with SMTP id w81mr12972404oig.8.1456771938803;
 Mon, 29 Feb 2016 10:52:18 -0800 (PST)
Original-Received: by 10.76.170.70 with HTTP; Mon, 29 Feb 2016 10:52:18 -0800 (PST)
In-Reply-To: <71766f85-7330-4387-8485-642e3f3ad003@isocpp.org>
X-Original-Sender: via.usov@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of via.usov@gmail.com designates 2607:f8b0:4003:c06::235 as permitted
 sender) smtp.mailfrom=via.usov@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:24843
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24843>

--001a113d38ceee6755052ced25a9
Content-Type: text/plain; charset=UTF-8

On Mon, Feb 29, 2016 at 6:47 PM, <daniele.bordes@gmail.com> wrote:

> The alternative to member function calls is using static methods of a
friend class and a procedural programming style; in my opinion, this is not
a mere syntactic question because:

I do not think you understood what I wrote.

Your concrete types (no virtual members) are representable by plain C
structures and plain C functions. Your desire to make the private parts of
your concrete parts invisible to the compiler is trivially achieved in
plain C by omitting the full definition of the structure in the interface
file.

The only thing not achieved by the above is the method call syntax.

>This is the opinion of Stroustroup about friend:

That opinion is decades old. Many things have changed since then. Here is
his opinion is a recent relevant document [1]:

The perceived *benefits* [2] are

[...]

   - *Decreased coupling / better encapsulation*: a class implementer does
   not have to place every function manipulating and object into the class.
   Only the minimal set of functions needing access to the object
   representation needs to be members. This simplifies comprehension and
   maintenance.


(end quote)

Cheers,
V.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0131r0.pdf

[2] My emphasis.

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg0wQ5Fc0MLP0no6tPip%2BpexrQvtsb0%2BUS_tRfFJ%2B9DQDg%40mail.gmail.com.

--001a113d38ceee6755052ced25a9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Feb 29, 2016 at 6:47 PM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:danie=
le.bordes@gmail.com" target=3D"_blank">daniele.bordes@gmail.com</a>&gt;</sp=
an> wrote:</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_qu=
ote"><div>&gt; The alternative to member function calls is using static met=
hods of a friend class and a procedural programming style; in my opinion, t=
his is not a mere syntactic question because:</div><div><br></div><div>I do=
 not think you understood what I wrote.<br></div><div><br></div><div>Your c=
oncrete types (no virtual members) are representable by plain C structures =
and plain C functions. Your desire to make the private parts of your concre=
te parts invisible to the compiler is trivially achieved in plain C by omit=
ting the full definition of the structure in the interface file.</div><div>=
<br></div><div>The only thing not achieved by the above is the method call =
syntax.</div><div><br></div><div>&gt;This is the opinion of Stroustroup abo=
ut friend:</div><div><br></div><div>That opinion is decades old. Many thing=
s have changed since then. Here is his opinion is a recent relevant documen=
t [1]:</div><div><br></div><div>The perceived <i><u><b>benefits</b></u></i>=
=C2=A0[2] are</div><div><br></div><div>[...]=C2=A0</div><div><ul><li><i>Dec=
reased coupling / better encapsulation</i>: a class implementer does not ha=
ve to place every
function manipulating and object into the class. Only the minimal set of fu=
nctions needing
access to the object representation needs to be members. This simplifies co=
mprehension and
maintenance.<br></li></ul></div><div><br></div><div>(end quote)</div><div><=
br></div><div>Cheers,</div><div>V.</div><div><br></div><div>[1]=C2=A0<a hre=
f=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0131r0.pdf">h=
ttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0131r0.pdf</a></div=
><div><br></div><div>[2] My emphasis.</div></div></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAA7YVg0wQ5Fc0MLP0no6tPip%2BpexrQvtsb=
0%2BUS_tRfFJ%2B9DQDg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg0wQ5=
Fc0MLP0no6tPip%2BpexrQvtsb0%2BUS_tRfFJ%2B9DQDg%40mail.gmail.com</a>.<br />

--001a113d38ceee6755052ced25a9--

.
