220 39142 <44ff0208-9ba9-4765-9983-e71125ed88fa@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: rmbeer2@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: new feature: declare data that replaces the
 previous one, or similar situation....
Date: Fri, 13 Jul 2018 05:36:07 -0700 (PDT)
Lines: 236
Approved: news@gmane.org
Message-ID: <44ff0208-9ba9-4765-9983-e71125ed88fa@isocpp.org>
References: <adc40bab-d824-440b-99b9-dab0ad6bd482@isocpp.org>
 <bebc25db-8a70-4f45-9694-f5e517dccbce@isocpp.org>
 <1263c0e2-9de4-4859-ba99-12fb770c93ba@isocpp.org>
 <503c3169-7bda-438b-ac1e-a6a7347b053f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_113519_1789480809.1531485367823"
X-Trace: blaine.gmane.org 1531485243 22077 195.159.176.226 (13 Jul 2018 12:34:03 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 13 Jul 2018 12:34:03 +0000 (UTC)
Cc: rmbeer2@gmail.com, mihailnajdenov@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDI6L6W3SYLBBOFZULNAKGQEXRY3NIQ@isocpp.org Fri Jul 13 14:33:59 2018
Return-path: <std-proposals+bncBDI6L6W3SYLBBOFZULNAKGQEXRY3NIQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f200.google.com ([209.85.213.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDI6L6W3SYLBBOFZULNAKGQEXRY3NIQ@isocpp.org>)
	id 1fdxGo-0005dE-Ml
	for gclcip-std-proposals@m.gmane.org; Fri, 13 Jul 2018 14:33:58 +0200
Original-Received: by mail-yb0-f200.google.com with SMTP id e6-v6sf22553988ybk.23
        for <gclcip-std-proposals@m.gmane.org>; Fri, 13 Jul 2018 05:36:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=2MdTzNBhtxapXBJAXcnHhpZdopozCm6aE4yED4FVSsI=;
        b=jkUOHJM0aUQ94GZiJNO6K4hC4nbuaG7YhT49Z/3LzekWnIWAmwdxBgnTXueG7hCoSo
         r5qjTUoy3FxIs5h5a0fXxMqwcGSEguTSQ4jIcrGldUaueMeaf/brCB+jWuqENG7Nh79H
         hAK3QSEH/qLomTpx25TeUBf5KWDybkucwUla5VNMxeIYwm+Cu85p3KVhyLmR6XJkeMLN
         4G8M/48HAzFHgt2HYWXdMT/fA1PrP3TulxSCxL7rxYoqFw6Hb44GDytlXlj6nMu8hD37
         b2imZpb10/FXow2N7wyu4ShPNjOygXnIiZ5P+4GxCIChH52KbT1ISM8qcR4Tt/gRdw0e
         355w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=2MdTzNBhtxapXBJAXcnHhpZdopozCm6aE4yED4FVSsI=;
        b=GDGDxHBUfUfCovsX2RRbK6GdLfcG1hS3wHUk6vFtHzxfsKN5vK4P3mKcDrbqEc0taK
         NxsQ/XgIMlJM6c6hEYN/oxncYv51k/gAPKL9Aczsip4K4lEgqU6O+Ux0B6blimzUylAY
         H7s8ScibjEsleWG9ushMKpc+BlLkQi4UN2orVqcaS7EZ7H8h8p4wGXFt9TEiO4xbzRtS
         UFNoQUG+bz1YvMDaDTEls279hiFKHQnjJEOs373/bWT1bv7ltguWLFxofrFVzoA33ukb
         /wbEMso15vf626Ra+a2t+drp/qsrDGUgFgXLZ6lDE3ihX85T3TG78WprdXjJSlUnU400
         rZLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc: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:list-subscribe:list-unsubscribe;
        bh=2MdTzNBhtxapXBJAXcnHhpZdopozCm6aE4yED4FVSsI=;
        b=Gur8RbQNsAM2/ZcVKLN9bwRYcUIxsdlcFIqfIzzZYPRd9IGWRlogKVmAcbyybJx0TA
         kx3/w2QhoZ41wzMvSYIqAfqiKdhUYi4FQLeXkbAtpw5STJnNcf54PWFTOBPZZyeCux4f
         RMAJJYwqUSmp0c2uFMqR7iEWCgZLuYGTkjm84peBrINwQfPx7zIG+Py91ZZXH2cBOKhw
         f/51kDyuBySqWaKzOeqbQGTkVKxtOnKpnPG5ALUm2zAmrgXahfX1kf9JP7emu2ZBcevI
         m90pt3bGuJupvES6CHxs0iKxFVXtZ1FYRwiiFS9sxG5VtOMTBpKyEBMAsyEcd/yCqvJv
         dRFQ==
X-Gm-Message-State: AOUpUlHmwGTy5rCDzqpV+9c5uuiZgPgU21Go7jScAov2u9YIOfivHNiN
	uc/0XcJKqNM7l39ZuSTqQGQ3MQ==
X-Google-Smtp-Source: AAOMgpfNoNpcHMXc+SaVCURyb881/D9zCBGOgCeLUKiln90xMbxFAUI+BKOJiClTzLmum1ZhsIrbjA==
X-Received: by 2002:a25:a290:: with SMTP id c16-v6mr1836877ybi.59.1531485369520;
        Fri, 13 Jul 2018 05:36:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a0d:f302:: with SMTP id c2-v6ls4118557ywf.13.gmail; Fri, 13
 Jul 2018 05:36:08 -0700 (PDT)
X-Received: by 2002:a81:5705:: with SMTP id l5-v6mr592673ywb.6.1531485368259;
        Fri, 13 Jul 2018 05:36:08 -0700 (PDT)
In-Reply-To: <503c3169-7bda-438b-ac1e-a6a7347b053f@isocpp.org>
X-Original-Sender: rmbeer2@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:39142
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39142>

------=_Part_113519_1789480809.1531485367823
Content-Type: multipart/alternative; 
	boundary="----=_Part_113520_840654334.1531485367823"

------=_Part_113520_840654334.1531485367823
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Is this really a C ++ standard language community? So far I have only=20
received 2 stupid answers and a huge silence after waiting a lot of time. I=
=20
expected more serious participation from the community as to how to solve=
=20
this problem, because evidently with the current language you can not.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D

Realmente esta es una comunidad de lenguaje estandar C++? Hasta ahora solo=
=20
he recibido 2 respuestas estupidas y un silencio enorme tras esperar un=20
monton de tiempo. Esperaba una participacion mas seria por parte de la=20
comunidad como pensar en como resolver este problema, porque evidentemente=
=20
con el lenguaje actual no se puede.


El viernes, 15 de junio de 2018, 5:55:43 (UTC-3), mihailn...@gmail.com=20
escribi=C3=B3:
>
> From what you presented you want to (literarily) override data so it is=
=20
> not duplicated. And there are many ways to do that, both statically or=20
> dynamically.=20
>
> I forgot Variant is also an option.
>
> The last solution is to simply not let data duplications happen by workin=
g=20
> with abstract classes.=20
>
>
> Alternatives aside, you can try implementing your solution with=20
> boilerplate code and see what is not there, if any, that make it impossib=
le=20
> and suggest something that might be useful outside that case as well,
>  and if everything is there, then you can suggest a library solution.
>
>
>
> On Friday, June 15, 2018 at 2:37:57 AM UTC+3, rmb...@gmail.com wrote:
>>
>> It seems that nobody else says it...
>> With template you just broke the structure of the classes, and did not=
=20
>> even take into account the class "A a;". And what is the last answer? It=
=20
>> does not explain anything. In short, no answer works...
>>
>> Parece que nadie mas lo comenta...
>> Con template simplemente acabaste de romper con la estructura de las=20
>> clases, y ni siquiera lo tomaste en cuenta la clase "A a;". Y en que=20
>> consiste la ultima respuesta? No explica nada. En fin, ninguna respuesta=
=20
>> sirve...
>>
>> El martes, 12 de junio de 2018, 4:28:30 (UTC-3), mihailn...@gmail.com=20
>> escribi=C3=B3:
>>>
>>> *Solution 2*
>>>
>>>
>>> template<class T>
>>> class B {
>>> public:
>>>     B(int i=3D1) : a(i) { }
>>>     void f2() {
>>>         std::cout << "A:" << a.z << std::endl;
>>>     }
>>> //    virtual A a; // Use A only from B
>>>     T a;
>>> };
>>> class D : public B<C> {
>>> public:
>>>     D() : B<C>(3) { }
>>>     void f2(){
>>>         std::cout << "C+A:" << a.z << std::endl;
>>>         B::f2();
>>>     }
>>> //    virtual C a; // Use C+A only from D
>>> };
>>>
>>>
>>> *Solution 3*
>>>
>>>
>>> class B=20
>>> {
>>> public:
>>>   B(A* a_) : a(a_) { }
>>>   B() : a(new A(1)) { }
>>>   void f2() {
>>>    std::cout << "A:" << a->z << std::endl;
>>>   }
>>> // virtual A a; // Use A only from B
>>>     std::unique_ptr<A> a;
>>> };
>>>
>>> class D : public B=20
>>> {
>>> public:
>>>   D() : B(new C(3)) { }
>>>   void f2(){
>>>     std::cout << "C+A:" << a->z << std::endl;
>>>     B::f2();
>>>   }
>>> // virtual C a; // Use C+A only from D
>>> };
>>>
>>>
>>> *Solution 4*
>>>
>>> Develop in terms of interfaces only
>>>
>>>
>>>

--=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/44ff0208-9ba9-4765-9983-e71125ed88fa%40isocpp.or=
g.

------=_Part_113520_840654334.1531485367823
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Is this really a C ++ standard language community? So far =
I have only received 2 stupid answers and a huge silence after waiting a lo=
t of time. I expected more serious participation from the community as to h=
ow to solve this problem, because evidently with the current language you c=
an not.<br><br>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>Realmente esta es una comunidad de le=
nguaje estandar C++? Hasta ahora solo he recibido 2 respuestas estupidas y =
un silencio enorme tras esperar un monton de tiempo. Esperaba una participa=
cion mas seria por parte de la comunidad como pensar en como resolver este =
problema, porque evidentemente con el lenguaje actual no se puede.<br><br><=
br>El viernes, 15 de junio de 2018, 5:55:43 (UTC-3), mihailn...@gmail.com e=
scribi=C3=B3:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
<div>From what you presented you want to (literarily) override data so it i=
s not duplicated. And there are many ways to do that, both statically or dy=
namically.=C2=A0</div><div><br></div><div>I forgot Variant is also an optio=
n.</div><div><br></div><div>The last solution is to simply not let data dup=
lications happen by working with abstract classes.=C2=A0</div><div><br></di=
v><div><br></div><div>Alternatives aside, you can try implementing your sol=
ution with boilerplate code and see what is not there, if any, that make it=
 impossible and suggest something that might be useful outside that case as=
 well,</div><div>=C2=A0and if everything is there, then you can suggest a l=
ibrary solution.</div><div><br></div><div><br></div><br>On Friday, June 15,=
 2018 at 2:37:57 AM UTC+3, <a>rmb...@gmail.com</a> wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div>It seems that nobody else says=
 it...<br></div><div>With template you just broke the structure of the clas=
ses, and did not even take into account the class &quot;A a;&quot;. And wha=
t is the last answer? It does not explain anything. In short, no answer wor=
ks...<br></div><div><br></div><div>Parece que nadie mas lo comenta...</div>=
<div>Con template simplemente acabaste de romper con la estructura de las c=
lases, y ni siquiera lo tomaste en cuenta la clase &quot;A a;&quot;. Y en q=
ue consiste la ultima respuesta? No explica nada. En fin, ninguna respuesta=
 sirve...<br></div><br>El martes, 12 de junio de 2018, 4:28:30 (UTC-3), <a>=
mihailn...@gmail.com</a> escribi=C3=B3:<blockquote class=3D"gmail_quote" st=
yle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr"><div><b><font face=3D"arial,sans-serif">Solution 2</fo=
nt></b></div><div><font face=3D"courier new,monospace"><b></b><font face=3D=
"arial,sans-serif"></font><br></font></div><div><font face=3D"courier new,m=
onospace"><br>template&lt;class T&gt;<br>class B {<br>public:<br>=C2=A0=C2=
=A0=C2=A0 B(int i=3D1) : a(i) { }<br>=C2=A0=C2=A0=C2=A0 void f2() {<br>=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; &quot;A:&quot; &=
lt;&lt; a.z &lt;&lt; std::endl;<br>=C2=A0=C2=A0=C2=A0 }<br>//=C2=A0=C2=A0=
=C2=A0 virtual A a; // Use A only from B<br>=C2=A0=C2=A0=C2=A0 T a;<br>};</=
font></div><div><font face=3D"courier new,monospace">class D : public B&lt;=
C&gt; {<br>public:<br>=C2=A0=C2=A0=C2=A0 D() : B&lt;C&gt;(3) { }<br>=C2=A0=
=C2=A0=C2=A0 void f2(){<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 std::=
cout &lt;&lt; &quot;C+A:&quot; &lt;&lt; a.z &lt;&lt; std::endl;<br>=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 B::f2();<br>=C2=A0=C2=A0=C2=A0 }<br>//=
=C2=A0=C2=A0=C2=A0 virtual C a; // Use C+A only from D<br>};</font></div><d=
iv><font face=3D"courier new,monospace"><br></font></div><div><font face=3D=
"arial,sans-serif"></font><b></b><br></div><div><font face=3D"arial,sans-se=
rif"><b>Solution 3</b></font></div><div><font face=3D"courier new,monospace=
"><br></font></div><font face=3D"courier new,monospace"><br><div>class B=C2=
=A0</div><div>{<br></div>public:<br>=C2=A0 B(A* a_) : a(a_) { }<br>=C2=A0 B=
() : a(new A(1)) { }<br>=C2=A0 void f2() {<br>=C2=A0=C2=A0 std::cout &lt;&l=
t; &quot;A:&quot; &lt;&lt; a-&gt;z &lt;&lt; std::endl;<br>=C2=A0 }<br>//   =
 virtual A a; // Use A only from B<br>=C2=A0 =C2=A0 std::unique_ptr&lt;A&gt=
; a;<br><div>};</div><div><br></div><div>class D : public B=C2=A0</div><div=
>{<br></div>public:<br>=C2=A0 D() : B(new C(3)) { }<br>=C2=A0 void f2(){<br=
>=C2=A0 =C2=A0 std::cout &lt;&lt; &quot;C+A:&quot; &lt;&lt; a-&gt;z &lt;&lt=
; std::endl;<br>=C2=A0 =C2=A0 B::f2();<br>=C2=A0 }<br>//    virtual C a; //=
 Use C+A only from D<br>};</font><div><font face=3D"arial,sans-serif"><b><b=
r></b></font></div><div><font face=3D"arial,sans-serif"><b><br></b></font><=
/div><div><font face=3D"arial,sans-serif"><b>Solution 4</b></font></div><di=
v><font face=3D"courier new,monospace"><font face=3D"arial,sans-serif"></fo=
nt><b></b><br></font></div><div><font face=3D"arial,sans-serif">Develop in =
terms of interfaces only</font></div><div><font face=3D"arial,sans-serif"><=
br></font></div><div><font face=3D"arial,sans-serif"></font><br></div></div=
></blockquote></div></blockquote></div></blockquote></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/44ff0208-9ba9-4765-9983-e71125ed88fa%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/44ff0208-9ba9-4765-9983-e71125ed88fa=
%40isocpp.org</a>.<br />

------=_Part_113520_840654334.1531485367823--

------=_Part_113519_1789480809.1531485367823--

.
