220 24911 <92a6bfcf-0100-40b2-8946-a9c634783ec9@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: "'Walt Karas' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "Components" template with implicitly defined
 partial specializations for all classes
Date: Thu, 3 Mar 2016 21:01:14 -0800 (PST)
Lines: 83
Approved: news@gmane.org
Message-ID: <92a6bfcf-0100-40b2-8946-a9c634783ec9@isocpp.org>
References: <fd64d8c9-703d-45d8-a9b2-4b8a222c02f0@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_369_153204546.1457067674823"
X-Trace: ger.gmane.org 1457067678 4244 80.91.229.3 (4 Mar 2016 05:01:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 4 Mar 2016 05:01:18 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDFLZXWOVYIBBHFN4S3AKGQECNCOFFY@isocpp.org Fri Mar 04 06:01:18 2016
Return-path: <std-proposals+bncBDFLZXWOVYIBBHFN4S3AKGQECNCOFFY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f198.google.com ([209.85.213.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDFLZXWOVYIBBHFN4S3AKGQECNCOFFY@isocpp.org>)
	id 1abhrZ-00061N-Vt
	for gclcip-std-proposals@m.gmane.org; Fri, 04 Mar 2016 06:01:18 +0100
Original-Received: by mail-ig0-f198.google.com with SMTP id o1sf22529983igz.1
        for <gclcip-std-proposals@m.gmane.org>; Thu, 03 Mar 2016 21:01:17 -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=+XgKjYs5cv+ug/NC8VvnHGpXDLuUw0Gp08aLtT0LTOI=;
        b=REUbI96YYsQeSZCUkutm58Fn/+er8l3nXXA8D2TqIozAmn+PptPhZ7T7DLEqH+eEl7
         Tmb0p0eu7YomJpBCv5VYJYPMPbNz7VzueDxbbC5Ci9eKBsRoUdbLT1SY7xi8+PfKKssE
         Wd2NqjPKL6pGHITbMzvh/6dziiyrN0XDuNQeTwKITahNsnSzMnqKXPE6H5Ly78AkLkBa
         +Hm0BaEuXNWlmiYZLsLOHSDjKs3eB9dFDGJcnrxMfDFH7I23bIHHj8zaRaOP13G5jno5
         RlNBwoxE1dr1uwWQkSWGMXAAdjs2lufgKunYndpOe1cUkk2OyWTyLb9lWQhAv0v19QRE
         cp6Q==
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=+XgKjYs5cv+ug/NC8VvnHGpXDLuUw0Gp08aLtT0LTOI=;
        b=YXQ6RBYtEex8gdLlPBPPqG4EnfS+gcLuMwT3WZDqVvAUYMk01yt/UEEw3rmGokcuNG
         eETEwMu09ZMPtLlCIbNVziflgyaI3tdGFO9wn5s3vhfUE3ftlpOvRkEvfuCKZ84OPrT6
         LrWYp4bztmBUDcoaEIeiHOaoAHdB+FHkEo3UF5c03gAdqxu3QVxO3oKkQAj2fulPEa4U
         j3yxgowwnDUosRCxdpoDDWtYVDJFJ1Ut804RCoOEejY+oiBoNyggg/M944WBvjG0Nt11
         qsnOilIimGJSo2mTWm66T/UPTC2UtXBNSUi1+BtFBJ9Qyobvw1dbuMoMfvxbCtLi+7ku
         A79A==
X-Gm-Message-State: AD7BkJLMDNpzExB7zTQfG6wZN8DorNStP7Fh1wm1M6vIdRudv/WVT27zMBgVn0eW8CMKJQ==
X-Received: by 10.182.247.68 with SMTP id yc4mr4548908obc.34.1457067677024;
        Thu, 03 Mar 2016 21:01:17 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.93.72 with SMTP id cs8ls172784igb.29.canary; Thu, 03 Mar
 2016 21:01:15 -0800 (PST)
X-Received: by 10.50.117.10 with SMTP id ka10mr87755igb.1.1457067675835;
        Thu, 03 Mar 2016 21:01:15 -0800 (PST)
In-Reply-To: <fd64d8c9-703d-45d8-a9b2-4b8a222c02f0@isocpp.org>
X-Original-Sender: wkaras@yahoo.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>
X-Original-From: Walt Karas <wkaras@yahoo.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:24911
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24911>

------=_Part_369_153204546.1457067674823
Content-Type: multipart/alternative; 
	boundary="----=_Part_370_661324883.1457067674823"

------=_Part_370_661324883.1457067674823
Content-Type: text/plain; charset=UTF-8

Another possible approach generic mapping of operations to components would 
be to accept the idiom ++C , C a class name, as a template parameter.  The 
compiler would implicitly expand ++C to multiple parameters, namely C 
itself, followed by a pair of parameters for each component of C.  Each 
pair would consist of  the type T of the component, followed by the member 
pointer of type T C::* to the component.  (The reason for using ++ is to 
suggest iteration of over the components.)  For 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 default 
comparison, input and display, persistence, endiance swap, hashing, etc. 
operations for many classes.  A difficult issue would be wether the context 
where X<++A> is instantiated would be required to have access to all the 
implicitly reverenced component types and components themselves.

Perhaps the compiler could also except the idiomatic template parameter 
--C, which would lay out the components in reverse order (of destruction) 
rather than forward order (of construction).

-- 
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/92a6bfcf-0100-40b2-8946-a9c634783ec9%40isocpp.org.

------=_Part_370_661324883.1457067674823
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Another possible approach generic mapping of operations to=
 components would be to accept the idiom ++C , C a class name, as a templat=
e parameter.=C2=A0 The compiler would implicitly expand ++C to multiple par=
ameters, namely C itself, followed by a pair of parameters for each compone=
nt of C.=C2=A0 Each pair would consist of=C2=A0 the type T of the component=
, followed by the member pointer of type T C::* to the component.=C2=A0 (Th=
e reason for using ++ is to suggest iteration of over the components.)=C2=
=A0 For example, for this class:<br><br>struct A { int i, j; double x; };<b=
r><br>the template instantiation:<br><br>X&lt;++A&gt;<br><br>would be equiv=
alent to:<br><br>X&lt;A, int, &amp;C::i, int, &amp;C::j, double, &amp;C::x&=
gt;<br><br>This hopefully would allow variadic templates to create reasonab=
le default comparison, input and display, persistence, endiance swap, hashi=
ng, etc. operations for many classes.=C2=A0 A difficult issue would be weth=
er the context where X&lt;++A&gt; is instantiated would be required to have=
 access to all the implicitly reverenced component types and components the=
mselves.<br><br>Perhaps the compiler could also except the idiomatic templa=
te parameter --C, which would lay out the components in reverse order (of d=
estruction) rather than forward order (of construction).<br></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/92a6bfcf-0100-40b2-8946-a9c634783ec9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/92a6bfcf-0100-40b2-8946-a9c634783ec9=
%40isocpp.org</a>.<br />

------=_Part_370_661324883.1457067674823--
------=_Part_369_153204546.1457067674823--

.
