220 25094 <11911c74-3792-4cbf-858b-d8c7aeb8e753@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: Wed, 9 Mar 2016 12:45:55 -0800 (PST)
Lines: 112
Approved: news@gmane.org
Message-ID: <11911c74-3792-4cbf-858b-d8c7aeb8e753@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>
 <741522c6-22f7-441d-81ab-e1ca44e085dc@isocpp.org>
 <b9f32b39-94e0-412f-9a87-6fe118b10b02@isocpp.org>
 <74980e61-cfdf-43b1-8bb4-e56263d083bb@isocpp.org>
 <4612cf90-7ca4-4d4e-9137-b535200a0950@isocpp.org>
 <b67154e5-36e4-4a8d-b07c-05139d6582ab@isocpp.org>
 <1bf9d1c6-5896-426c-bd5f-422b0492800f@isocpp.org>
 <0519dbd8-89d0-4e71-90af-e4131dffdea4@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_6615_255236201.1457556355979"
X-Trace: ger.gmane.org 1457556364 22186 80.91.229.3 (9 Mar 2016 20:46:04 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 9 Mar 2016 20:46:04 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDFLZXWOVYIBBBMXQK3QKGQEMK2IFHY@isocpp.org Wed Mar 09 21:46:00 2016
Return-path: <std-proposals+bncBDFLZXWOVYIBBBMXQK3QKGQEMK2IFHY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yk0-f199.google.com ([209.85.160.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDFLZXWOVYIBBBMXQK3QKGQEMK2IFHY@isocpp.org>)
	id 1adkzX-0007DY-6l
	for gclcip-std-proposals@m.gmane.org; Wed, 09 Mar 2016 21:45:59 +0100
Original-Received: by mail-yk0-f199.google.com with SMTP id r203sf70818967ykd.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Mar 2016 12:45:58 -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=LKdxZCWfeDnwLOrizRDR4GHKDIDhur6RsrZMudD8P14=;
        b=SH6teRg51Di9ukfVjMTi19lk7JP+/sMO8TfLmGDN4QEWgbGH+zrib+Sa+sLqx8eBlY
         zL1ct0sK9DEEPNP2zC2sT17fUo0cJfrneo+aFwQr938jAMoCBHabJPIWemuOTwbCT0F/
         okqzpH3fETD83lZm1CoEcJMecnUmaJixcuBBhwQ8bCqJViCxq0C8g1tzl444efgUwuPx
         p1nXFgeUkECbrABgxj1p+wkeYVD5ODWG5r5s4PVV3KZRKgQJJnwdR+C0SoyEoE1h+e2A
         uAzC6PxZtm6AuPOYBcoasL2Y2LZvJhFuoBn9n0smcsZQEIzgTznpr+WxFU+NjFpXvKJW
         Lkbw==
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=LKdxZCWfeDnwLOrizRDR4GHKDIDhur6RsrZMudD8P14=;
        b=OKYhWhqqdDc26RAmb+sVK3KJhtbRtBcBgy1IEactpwnImtY6hdE8qUpfcW9B8v/q8B
         pqNEasnsYjZzoLWzmskYbeRc9Pee9lIzQ6pNwEuLuP3bE/6QPz2+qw59bykhktb8vSyt
         xTio1xHW1XVC8oHD4pjjQPY62ApPMNEwF0LpPi4SXONMckq/I1GBAG0BGhVuoOH0P9qC
         RrJ6LsmWx5K8BZhAwSnmYdOlgPQ7U460tyi5zl4bFgLqHKfJ0t18gCH5w7R2LRbFpdbO
         cS57JF7/dm7ZDTYAG2/Xi2vwSk/zwpbyTI51ATlOHRWNDEYGhy3yA9xgMEqWJ5UcKI5d
         uugg==
X-Gm-Message-State: AD7BkJLjeefWG+IREBXvtNb/1gBZS+K3ofiOjKe7CkYC96rJSLCtSsTLt4sM1GWVKfzUdg==
X-Received: by 10.129.39.146 with SMTP id n140mr210258ywn.22.1457556358270;
        Wed, 09 Mar 2016 12:45:58 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.43.162 with SMTP id x2ls15367igl.34.gmail; Wed, 09 Mar 2016
 12:45:57 -0800 (PST)
X-Received: by 10.50.43.234 with SMTP id z10mr12943igl.4.1457556356994;
        Wed, 09 Mar 2016 12:45:56 -0800 (PST)
In-Reply-To: <0519dbd8-89d0-4e71-90af-e4131dffdea4@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:25094
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25094>

------=_Part_6615_255236201.1457556355979
Content-Type: multipart/alternative; 
	boundary="----=_Part_6616_175938585.1457556355980"

------=_Part_6616_175938585.1457556355980
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Wednesday, March 9, 2016 at 3:05:16 PM UTC-5, Cleiton Santoia wrote:
>
> A hopefully illustrative concrete example:
>>
>> struct A { int i; };
>> struct B { int i; };
>> struct C : public A, public B { };
>> struct D { int i, j; };
>>
> =20
>
>> B C::*p1 =3D &C:::B;
>> int D::*p2 =3D &D::j;
>>
>> p1 and p2 would be initialized with the same numeric value from a machin=
e=20
>> language point of view.  Typically 4 on a 32-bit architecture.
>>
>
>
> The type of p1 is "B member object of C"=20
> The type pf p2 is "int member object of D"
>
> p2, I understand, to use it, you must;=20
>
> D d; // instantiate d
> d.*p2 =3D 10; // same as D.j =3D 10; i can assign an int here
>
> p1 I don=C2=B4t, you must;=20
>
> C c; // instantiate c
> c.*p1 =3D B()  // what can i assign here ? a instance of B ?
>

Yes that would work.  This:

c.*p1 =3D B();
(c.*.p1).i =3D 5;

would make the same changes to c as:

static_cast<B &)(c) =3D B();
static_cast<B &>(c).i =3D 5;

--=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/11911c74-3792-4cbf-858b-d8c7aeb8e753%40isocpp.or=
g.

------=_Part_6616_175938585.1457556355980
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, March 9, 2016 at 3:05:16 PM UTC-5, C=
leiton Santoia wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><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>A ho=
pefully illustrative concrete example:<br><br>struct A { int i; };<br>struc=
t B { int i; };<br>struct C : public A, public B { };<br>struct D { int i, =
j; };<br></div></div></blockquote><div>=C2=A0</div><blockquote class=3D"gma=
il_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><div>B C::*p1 =3D &amp;C:::B;<br>int D::*p=
2 =3D &amp;D::j;<br><br>p1 and p2 would be initialized with the same numeri=
c value from a machine language point of view.=C2=A0 Typically 4 on a 32-bi=
t architecture.<br></div></div></blockquote><div><br></div><div><br></div><=
div>The type of p1 is &quot;B member object of C&quot;=C2=A0<br></div><div>=
<div>The type pf p2 is &quot;int member object of D&quot;</div></div><div><=
br></div><div>p2, I understand, to use it, you must;=C2=A0</div><div><br></=
div><div>D d; // instantiate d</div><div>d.*p2 =3D 10; // same as D.j =3D 1=
0; i can assign an int here</div><div><br></div><div>p1 I don=C2=B4t, you m=
ust;=C2=A0</div><div><br></div><div>C c; // instantiate c</div><div>c.*p1 =
=3D B() =C2=A0// what can i assign here ? a instance of B ?</div></div></bl=
ockquote><div><br>Yes that would work.=C2=A0 This:<br><br>c.*p1 =3D B();<br=
>(c.*.p1).i =3D 5;<br><br>would make the same changes to c as:<br><br>stati=
c_cast&lt;B &amp;)(c) =3D B();<br>static_cast&lt;B &amp;&gt;(c).i =3D 5;<br=
></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/11911c74-3792-4cbf-858b-d8c7aeb8e753%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/11911c74-3792-4cbf-858b-d8c7aeb8e753=
%40isocpp.org</a>.<br />

------=_Part_6616_175938585.1457556355980--
------=_Part_6615_255236201.1457556355979--

.
