220 25053 <741522c6-22f7-441d-81ab-e1ca44e085dc@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Cleiton Santoia <cleitonsantoia@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "Components" template with implicitly defined
 partial specializations for all classes
Date: Tue, 8 Mar 2016 08:31:07 -0800 (PST)
Lines: 153
Approved: news@gmane.org
Message-ID: <741522c6-22f7-441d-81ab-e1ca44e085dc@isocpp.org>
References: <fd64d8c9-703d-45d8-a9b2-4b8a222c02f0@isocpp.org>
 <56D9E17F.2070202@wanadoo.fr>
 <2b0bcca0-0939-49f7-939b-4d688f8dfe34@isocpp.org>
 <324dbff9-84da-46f2-b2f3-3d9fe0cc2082@isocpp.org>
 <cc5a1d38-d1f0-4e41-9ee1-29bad95bb15e@isocpp.org> <56DA88DF.90000@wanadoo.fr>
 <c303f05a-15d4-445f-81f8-e12f67842bcc@isocpp.org>
 <7e46c46d-2e18-4cec-92c1-4f4d7fbc786b@isocpp.org>
 <d6495758-627e-434d-a867-ed473d869f47@isocpp.org>
 <39bbeb02-62b8-497b-8d65-5780a6baca97@isocpp.org>
 <05ac78e7-3d30-4a99-ad0f-a3d29497e2ff@isocpp.org>
 <2c7cb187-ad83-4ceb-af8b-1e61d4fb4d0d@isocpp.org>
 <56DD28C8.7020708@wanadoo.fr>
 <840b1f9a-be05-4454-b20d-99e2ccb3c1f1@isocpp.org>
 <390f2de7-6ab3-47cc-b76c-a7454dec5fc5@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_180_1155276388.1457454667175"
X-Trace: ger.gmane.org 1457454673 20322 80.91.229.3 (8 Mar 2016 16:31:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 8 Mar 2016 16:31:13 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCBMVWMTUUNBBTH47O3AKGQEF3SGYYI@isocpp.org Tue Mar 08 17:31:13 2016
Return-path: <std-proposals+bncBCBMVWMTUUNBBTH47O3AKGQEF3SGYYI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qg0-f69.google.com ([209.85.192.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCBMVWMTUUNBBTH47O3AKGQEF3SGYYI@isocpp.org>)
	id 1adKXO-0007mN-EJ
	for gclcip-std-proposals@m.gmane.org; Tue, 08 Mar 2016 17:31:10 +0100
Original-Received: by mail-qg0-f69.google.com with SMTP id y89sf18551270qge.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 08 Mar 2016 08:31:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive:sender
         :list-subscribe:list-unsubscribe;
        bh=CXRfJGJnwbXLbiYdVlEsG4yQfVBTt7RLxOGE3B4LW1w=;
        b=sfQalBXLlmLEmaG9OCImKXJ/sfDBoafFlA4MSA7JRwmBJ53fLZ/NTvRu5A5sCz1pAZ
         Nk9hY/eq26wwMLDclZrJyPUDZpDFYISS3VJCf1kt6WvHKSXdeu7GKevQxESnAwO6yu18
         v2lLXJcpczyfiue4gmkGmcv1rLQH5kMVIL+BnRV4nHc6bkdBLIhzNr/rF0YbHdfcy6M8
         LW3ti61PxzR4/1SpgICTEJ8RKbRleGAtYP9mVyIXcCrETEPa7A+7hCvqhjMj3yOIylPw
         cGt8Z5u3Uh9rlctG9tUFwVGWrAa/0qUTzDDty4tDhq0e1i90t9oIw2OMt+Cisp/b1/0Z
         aKKw==
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
         :x-spam-checked-in-group:list-post:list-help:list-archive:sender
         :list-subscribe:list-unsubscribe;
        bh=CXRfJGJnwbXLbiYdVlEsG4yQfVBTt7RLxOGE3B4LW1w=;
        b=qym4z0fMnVmU5Vt6ht5xrWE3vo3KKt3wSH7OZv01PHVU/DOPshVSh15stiT6RE3jk9
         a9G/IzKJdnMyUGP26+l2fuH8R7MS1Ejmxr5CrPQNFGx0O0IfXraTj+RVDLxKA0qKW3VP
         OX8IAe6wDaekWd6hAEklubSblX86iG2tswmbJUD54LhRHkVUabqkwitJWb6bIhsba1ld
         vrqp6wZXmEtCJIRclP7vUD7Sntq0len0ZKB/LVU17dxLLiKmBs+D2/rBB1S9Xj1LGoMU
         u8Xkd/G6xbxZKLyUt/FESYWW2wUkI8sE1OApoSNUudbXi2vfeVM0QL8l7JUwOwRqV7lK
         scMw==
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:x-spam-checked-in-group:list-post:list-help
         :list-archive:sender:list-subscribe:list-unsubscribe;
        bh=CXRfJGJnwbXLbiYdVlEsG4yQfVBTt7RLxOGE3B4LW1w=;
        b=hoxG3cJ4DtLY1gztGJshcLPkrCpHeWspON6fPcik76NWCu+TEm0A+14unYtVG764LX
         AbzVQ15MpnHu+6xCovXjK7Q4vwTnB4CQebEmgTRrcfrnxB09N14C2ydaqFOo8SVEVs25
         +RNpX3CQCIE+9tuh7CP3LLDPmwwWwr85ZKjyDpSsoMmF0Sodd7Y9Cai8w/wbsUY6xQIb
         x3wr9nc+orHrSJ5pisF8hvkVdq8qk6tDR/07rUduZbisvpc8Oqx++xeHK6VW0IEYpYf4
         aj6juk/XfqcasR9NXgJRzoRD8Zrprt4or4H2rOWmYw/WFLEeCcocB05Z7/4f+nX3dRek
         vkjQ==
X-Gm-Message-State: AD7BkJJK88YmHRUk6jnW/DpG8r7Ye5kk6gbEmWU6sk4rBUKvcMzCDhlFX5FMPAsM9Jatjg==
X-Received: by 10.140.176.6 with SMTP id w6mr200515qhw.23.1457454669285;
        Tue, 08 Mar 2016 08:31:09 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.82.105 with SMTP id h9ls280312igy.25.gmail; Tue, 08 Mar
 2016 08:31:08 -0800 (PST)
X-Received: by 10.50.25.167 with SMTP id d7mr221841igg.7.1457454668106;
        Tue, 08 Mar 2016 08:31:08 -0800 (PST)
In-Reply-To: <390f2de7-6ab3-47cc-b76c-a7454dec5fc5@isocpp.org>
X-Original-Sender: cleitonsantoia@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/>
Original-Sender: std-proposals@isocpp.org
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:25053
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25053>

------=_Part_180_1155276388.1457454667175
Content-Type: multipart/alternative; 
	boundary="----=_Part_181_1148837050.1457454667175"

------=_Part_181_1148837050.1457454667175
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


>
> In the example you gave for a generic =3D=3D operator, the equals_helper=
=20
> template function could be wrapped in a helper class. A class with=20
> non-public data components could friend the helper class if the generic=
=20
> operator was correct for it.  In a sense, the default constructors,=20
> destructor and assignment operator are all reinventions of the "foreach=
=20
> component reflection" wheel.  We can continue the multiple reinventions f=
or=20
> the comparison operators (also a violation of strictest respect for acces=
s=20
> control).  Or (assuming that friending a helper class works in general)=
=20
> classes with non-public data components can acknowledge library default=
=20
> functions and operators with a single simple friend declaration.  Lobbyis=
ts=20
> for companies wanting to sell library include file upgrades will wine and=
=20
> dine the Committee in support of this.
>

My intent is to make a two cents contribution and show how terse and easy=
=20
can be (reflection + folding) to solve the problem of the subject of this=
=20
topic, also give a alternative solution than you thought, without need for=
=20
mapping classes nor "Component/Class/Fields" structures. I=C2=B4m not tryin=
g to=20
provide the whole solution for default comparison nor solve all issues in L=
awrence=20
Crowl =E2=80=9CComparison is not simple, but it can be simpler"=20
<https://www.youtube.com/watch?v=3Dfi0CQ7laiXE> but if you wish, you can sh=
ow=20
us your idea then we can comment on it.

=20

> Since you mention an is_base predicate, I assume that means you have some=
=20
> sort of member pointer to a base class, but I see no explicit discussion =
of=20
> that.=20
>

Sorry, I did not get this, why you need a member pointer to a base class ?=
=20

struct X{
};

struct Y : X {
   X* base;
};

you mean this ???

--=20
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 e=
mail 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/741522c6-22f7-441d-81ab-e1ca44e085dc%40isocpp.or=
g.

------=_Part_181_1148837050.1457454667175
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bor=
der-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>In the e=
xample you gave for a generic =3D=3D operator, the equals_helper template f=
unction could be wrapped in a helper class. A class with non-public data co=
mponents could friend the helper class if the generic operator was correct =
for it.=C2=A0 In a sense, the default constructors, destructor and assignme=
nt operator are all reinventions of the &quot;foreach component reflection&=
quot; wheel.=C2=A0 We can continue the multiple reinventions for the compar=
ison operators (also a violation of strictest respect for access control).=
=C2=A0 Or (assuming that friending a helper class works in general) classes=
 with non-public data components can acknowledge library default functions =
and operators with a single simple friend declaration.=C2=A0 Lobbyists for =
companies wanting to sell library include file upgrades will wine and dine =
the Committee in support of this.</div></div></blockquote><div><br></div><d=
iv>My intent is to make a two cents contribution and show how terse and eas=
y can be (reflection + folding) to solve the problem of the subject of this=
 topic, also give a alternative solution than you thought, without need for=
 mapping classes nor &quot;Component/Class/Fields&quot; structures. I=C2=B4=
m not trying to provide the whole solution for default comparison nor solve=
 all issues in <a href=3D"https://www.youtube.com/watch?v=3Dfi0CQ7laiXE">La=
wrence Crowl =E2=80=9CComparison is not simple, but it can be simpler&quot;=
</a>=C2=A0but if you wish, you can show us your idea then we can comment on=
 it.</div><div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote"=
 style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-=
left: 1ex;"><div dir=3D"ltr"><div>Since you mention an is_base predicate, I=
 assume that means you have some sort of member pointer to a base class, bu=
t I see no explicit discussion of that. <br></div></div></blockquote><div><=
br></div><div>Sorry, I did not get this, why you need a member pointer to a=
 base class ?=C2=A0</div><div><br></div><div><div class=3D"prettyprint" sty=
le=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; backgrou=
nd-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"su=
bprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">str=
uct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> X</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">};</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br><br></span><span style=3D"color:=
 #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> Y </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> X </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br>=C2=A0 =C2=A0X</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">*</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">base</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">};</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br></span></div></code></div><div><=
br></div>you mean this ???</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/741522c6-22f7-441d-81ab-e1ca44e085dc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/741522c6-22f7-441d-81ab-e1ca44e085dc=
%40isocpp.org</a>.<br />

------=_Part_181_1148837050.1457454667175--
------=_Part_180_1155276388.1457454667175--

.
