220 24925 <3c8bb230-c83b-4c18-95b6-1cc32caae76d@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: Fri, 4 Mar 2016 10:02:43 -0800 (PST)
Lines: 117
Approved: news@gmane.org
Message-ID: <3c8bb230-c83b-4c18-95b6-1cc32caae76d@isocpp.org>
References: <fd64d8c9-703d-45d8-a9b2-4b8a222c02f0@isocpp.org>
 <92a6bfcf-0100-40b2-8946-a9c634783ec9@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1177_328122249.1457114563966"
X-Trace: ger.gmane.org 1457114575 17634 80.91.229.3 (4 Mar 2016 18:02:55 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 4 Mar 2016 18:02:55 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCBMVWMTUUNBBRU3463AKGQEKF6PBRY@isocpp.org Fri Mar 04 19:02:50 2016
Return-path: <std-proposals+bncBCBMVWMTUUNBBRU3463AKGQEKF6PBRY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f72.google.com ([209.85.220.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCBMVWMTUUNBBRU3463AKGQEKF6PBRY@isocpp.org>)
	id 1abu3s-0006Rd-B1
	for gclcip-std-proposals@m.gmane.org; Fri, 04 Mar 2016 19:02:48 +0100
Original-Received: by mail-pa0-f72.google.com with SMTP id fl4sf73904553pad.2
        for <gclcip-std-proposals@m.gmane.org>; Fri, 04 Mar 2016 10:02:48 -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=ssxicBYeCcsOrbooHDmwl17NtxDx4b8GYCCZiqq45Cc=;
        b=LM8/fkxrKnGufrPadRQkmAdCvLHqmkm9r2SVaUXK+8LzbxOtchWjaIsFeUhdHsgRcw
         nqjaChI/SMe0FCe3gefhmBbLSUCN9ntcqPFL2Zv88gQRr//HC/PNgOp0okXoNz6aseMQ
         HjV7du9YcypYNfzGwuKPPoV9JlmcecmruK+reoSd3lR6QTzoVBsHyROJXPBikz9WVk7e
         UoC+I0AXCsTkCkMqRNgYJIrNKWxWfCFPQwCS2xfPzziEDaX4bA6Y1//vGK2KGOo4dP/R
         EX7red6SEfTy4fL+wQpFYOt3TjfL96YWg92O03kEemU4Lqp3e7MBE6D/te/aY68txKau
         Cz8Q==
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=ssxicBYeCcsOrbooHDmwl17NtxDx4b8GYCCZiqq45Cc=;
        b=KVOqqt+xRAYFqakfWC+7MWGmOQcJxC9cPXaC1vux9UvoeZF/79QZzGNX5/Cx08b6HT
         iH+6dxaGh9aGTZMNHmwTWWCbsp1iVGCpmywhgRDYAP+Mqt9biLaz74/DOhtOULXy/pu0
         tJTnPb40hHrdu/KpZHBbttyk7ykl9XYpAqlH1WfDd26LCVsAni9SQlYsb1PdXZUYVrEx
         SC+ItO/cdYpxvd8TYgLVjG8IRdX9Myo1h8qk9J/uQk7tswqG9hBePUPxjFNL/UIplF3z
         tBW5/LUi5iJ18u+4a0O6P0ymZpwryxTHe6VOTC5dlkfYxCK2M5GrzRTzPj3nWVV9fupE
         rNxA==
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=ssxicBYeCcsOrbooHDmwl17NtxDx4b8GYCCZiqq45Cc=;
        b=WewchGh4nfZ9kvc864Og++kkxedH7y3Wm7lB3KiuZhu4yPTOEEkfaijFr9Yx5vRFIm
         QLEBsUlfBSruE+t9rnK4Us3OaESG+P6cPhOKQXeZgk1jzlK+ls4z8nyGfIKgSorqrfOi
         IoZi1txqCTDECtw/bICh5orKFPxM0AqROxDPm9JBp8fxrcZUPgJssbnPwjbH9PCcoGZV
         Qfuktq2deO7yTpE9aBZcwqXoei80lj5Q1j7NZAvjEiJ5mcBp5NzBym74PAHpef2mBSGX
         s1WmXbmR0bVdHed9M4AjYlP+udL3fYZWcglRECIC6eyyePfa6Dg0BJN3c+McAciZgDAB
         Vn7Q==
X-Gm-Message-State: AD7BkJKRUHRsNs17Xaezs2Zcho+TFQpAJq12L82lykRt4W4MrwSZpHYCLj92/k+/fjd0ZA==
X-Received: by 10.66.171.167 with SMTP id av7mr6597589pac.17.1457114567215;
        Fri, 04 Mar 2016 10:02:47 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.67.69 with SMTP id l5ls367100igt.30.canary; Fri, 04 Mar
 2016 10:02:45 -0800 (PST)
X-Received: by 10.50.43.234 with SMTP id z10mr9782igl.4.1457114565912;
        Fri, 04 Mar 2016 10:02:45 -0800 (PST)
In-Reply-To: <92a6bfcf-0100-40b2-8946-a9c634783ec9@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:24925
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24925>

------=_Part_1177_328122249.1457114563966
Content-Type: multipart/alternative; 
	boundary="----=_Part_1178_1609385642.1457114563967"

------=_Part_1178_1609385642.1457114563967
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


   Reflection ? p0255r0=20
<http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0255r0.pdf>

X<typedef<A>...> solves your case....




Em sexta-feira, 4 de mar=C3=A7o de 2016 02:01:15 UTC-3, Walt Karas escreveu=
:
>
> Another possible approach generic mapping of operations to components=20
> would be to accept the idiom ++C , C a class name, as a template=20
> parameter.  The compiler would implicitly expand ++C to multiple=20
> parameters, namely C itself, followed by a pair of parameters for each=20
> component of C.  Each pair would consist of  the type T of the component,=
=20
> followed by the member pointer of type T C::* to the component.  (The=20
> reason for using ++ is to suggest iteration of over the components.)  For=
=20
> example, for this class:
>
> struct A { int i, j; double x; };
>
> the template instantiation:
>
> X<++A>
>
> would be equivalent to:
>
> X<A, int, &C::i, int, &C::j, double, &C::x>
>
> This hopefully would allow variadic templates to create reasonable defaul=
t=20
> comparison, input and display, persistence, endiance swap, hashing, etc.=
=20
> operations for many classes.  A difficult issue would be wether the conte=
xt=20
> where X<++A> is instantiated would be required to have access to all the=
=20
> implicitly reverenced component types and components themselves.
>
> Perhaps the compiler could also except the idiomatic template parameter=
=20
> --C, which would lay out the components in reverse order (of destruction)=
=20
> rather than forward order (of construction).
>

--=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/3c8bb230-c83b-4c18-95b6-1cc32caae76d%40isocpp.or=
g.

------=_Part_1178_1609385642.1457114563967
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><br></div>=C2=A0 =C2=A0Reflection ?=C2=A0<a href=3D"h=
ttp://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0255r0.pdf">p0255r0</a>=
<div><br></div><div>X&lt;typedef&lt;A&gt;...&gt; solves your case....</div>=
<div><br></div><div><br></div><div><br><br>Em sexta-feira, 4 de mar=C3=A7o =
de 2016 02:01:15 UTC-3, Walt Karas  escreveu:<blockquote class=3D"gmail_quo=
te" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddi=
ng-left: 1ex;"><div dir=3D"ltr">Another possible approach generic mapping o=
f operations to components would be to accept the idiom ++C , C a class nam=
e, as a template parameter.=C2=A0 The compiler would implicitly expand ++C =
to multiple parameters, namely C itself, followed by a pair of parameters f=
or each component of C.=C2=A0 Each pair would consist of=C2=A0 the type T o=
f the component, followed by the member pointer of type T C::* to the compo=
nent.=C2=A0 (The reason for using ++ is to suggest iteration of over the co=
mponents.)=C2=A0 For example, for this class:<br><br>struct A { int i, j; d=
ouble x; };<br><br>the template instantiation:<br><br>X&lt;++A&gt;<br><br>w=
ould be equivalent to:<br><br>X&lt;A, int, &amp;C::i, int, &amp;C::j, doubl=
e, &amp;C::x&gt;<br><br>This hopefully would allow variadic templates to cr=
eate reasonable default comparison, input and display, persistence, endianc=
e swap, hashing, etc. operations for many classes.=C2=A0 A difficult issue =
would be wether the context where X&lt;++A&gt; is instantiated would be req=
uired to have access to all the implicitly reverenced component types and c=
omponents themselves.<br><br>Perhaps the compiler could also except the idi=
omatic template parameter --C, which would lay out the components in revers=
e order (of destruction) rather than forward order (of construction).<br></=
div></blockquote></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/3c8bb230-c83b-4c18-95b6-1cc32caae76d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3c8bb230-c83b-4c18-95b6-1cc32caae76d=
%40isocpp.org</a>.<br />

------=_Part_1178_1609385642.1457114563967--
------=_Part_1177_328122249.1457114563966--

.
