220 31694 <1b33375c-526b-4e20-a691-a85d512fa4a8@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Denis Kotov <redradist@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Simplify virtual inheritance rules
Date: Sun, 19 Mar 2017 06:07:04 -0700 (PDT)
Lines: 221
Approved: news@gmane.org
Message-ID: <1b33375c-526b-4e20-a691-a85d512fa4a8@isocpp.org>
References: <6aa2e439-345e-4f04-8843-f38bb7b825b2@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_713_2045404918.1489928824934"
X-Trace: blaine.gmane.org 1489928830 28561 195.159.176.226 (19 Mar 2017 13:07:10 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 19 Mar 2017 13:07:10 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDY2PNGE6QOBB6MEXLDAKGQERF4JQMA@isocpp.org Sun Mar 19 14:07:05 2017
Return-path: <std-proposals+bncBDY2PNGE6QOBB6MEXLDAKGQERF4JQMA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f71.google.com ([209.85.214.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDY2PNGE6QOBB6MEXLDAKGQERF4JQMA@isocpp.org>)
	id 1cpaY0-0006TA-J8
	for gclcip-std-proposals@m.gmane.org; Sun, 19 Mar 2017 14:07:00 +0100
Original-Received: by mail-it0-f71.google.com with SMTP id r141sf95506970ita.6
        for <gclcip-std-proposals@m.gmane.org>; Sun, 19 Mar 2017 06:07:06 -0700 (PDT)
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
         :list-subscribe:list-unsubscribe;
        bh=Os2baB5RjxpvLkV3WKmM+YlneeIioxxh7k44/U8fTGs=;
        b=RxHS7GgK7Muyl8wkY4I9onpHF2hGLAlTEMW7CxOEW2m//82T3wGzocGS467+px3Q4q
         j8jP2qNaWcePQHVFzjfdjM6pJTqcyDK9oCCN58ZNWThcp4p4fMfqxhKAsRmuozI8cnbv
         ygImANE5PJA4ITNVIvmN329a4xYxVGBztsAc/JqfoYYY2wib9ks1mk/hVjI2mEdtOjQO
         n/Hhlw3zOPX3dRtwWqXby2rHd+deo7hgZJI0sFF+XZpm2/OKAPTWTj9GDN2Nb7XamNzq
         pqc6NBHlr2XOgVYE0C8d11TukpvsxTYwcMT0Hnx0D1Xr6mZR0q4ZhcAvjUZQZycSc8Gy
         uICQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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
         :list-subscribe:list-unsubscribe;
        bh=Os2baB5RjxpvLkV3WKmM+YlneeIioxxh7k44/U8fTGs=;
        b=E5LBP39Dt4DOCS1uIaE6cM9tmc6eS16JP+J5KHvrhjs+JBI+O71KCK3Pd9zQtpRtq+
         /DjSF8GiUk2Uxd1v4WzyDZ3wl2U6y1vK5RvQVUkYeRT/lWdiw8OJARuNkHcwdNHKye72
         KT7bnSo76zimOJTYnA/0sJz/cvt3ZEzpjoUt7UL1lyHNZXlo52v55oFUgj3/+d3N4oxx
         sL5zo9aXDowO3Qoe9wraPTWfzinBAmJeG9BzVu/7EsM0WXLAoKmZQ7nZDk2WtPxl7yUM
         9Ztu/l/yEUj/cGxlwKpajYQHxoAOwYn/tFrsjV6WcNtMvysF7GVa41Ilx7wIrSR+aJl/
         6VrQ==
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: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=Os2baB5RjxpvLkV3WKmM+YlneeIioxxh7k44/U8fTGs=;
        b=qB4OkjdX870HWhQMO3s+jNB2ba+9cSh2UWHLki5d+UAgBBsaV4k0DhPy8HkD0UACHF
         EUDjXEjLCEhdvsBQkJvnIYoepw62NMljgIHihXtTf2CvwYQOubtlEK/pYSvb3RPth85P
         bicoU+db/g+V1ZXaSAeDwrPDqdDaqyONhcY7kdDPtA6QqzgZCYuNAQjoKZ5xjmFCvJF1
         Y10hTOigTuQBuFxJrp17EhEDkVC5h5N9B+mJaaszR+fuJscvKDgxnHl9SSAwIDq7kyLK
         EFoBr0frznJaNjHmRIaHKlNx1lz4OFIMIhgV/kMEBPcujB+QwbEQ/nMe9wElRL3T6Tqc
         CyAw==
X-Gm-Message-State: AFeK/H0Js8NN7XvFe/THkngYRO4pzEXqtV6zEuL1g6t+/3LcmujDdIgbucn9ujhBa6ZxZg==
X-Received: by 10.36.89.138 with SMTP id p132mr205113itb.24.1489928826133;
        Sun, 19 Mar 2017 06:07:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.2.98 with SMTP id 89ls8775526otb.22.gmail; Sun, 19 Mar
 2017 06:07:05 -0700 (PDT)
X-Received: by 10.157.61.131 with SMTP id l3mr2397635otc.1.1489928825318;
        Sun, 19 Mar 2017 06:07:05 -0700 (PDT)
In-Reply-To: <6aa2e439-345e-4f04-8843-f38bb7b825b2@isocpp.org>
X-Original-Sender: redradist@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:31694
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31694>

------=_Part_713_2045404918.1489928824934
Content-Type: multipart/alternative; 
	boundary="----=_Part_714_1735362021.1489928824934"

------=_Part_714_1735362021.1489928824934
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

To share my view more clear I have added a new picture:

<https://lh3.googleusercontent.com/-K-Qmdj7-vio/WM6CYV4X4OI/AAAAAAAAFRE/VgM=
pfnwSEQcIrdxPaMU9nlUJksrijhrpQCLcB/s1600/Simplify%2Brules%2Bfor%2Bvirtual%2=
Binheritance.png>


=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 18 =D0=BC=D0=B0=D1=80=D1=82=D0=
=B0 2017 =D0=B3., 21:31:32 UTC+2 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=
=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Denis Kotov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=
=D0=B0=D0=BB:
>
> Hi everyone,
>
>
> My proposal is to simplify virtual inheritance rules. Consider the=20
> following class hierarchy:
>
>
> <https://lh3.googleusercontent.com/-h-cp0qNBSRI/WM2Ks4N6-3I/AAAAAAAAFQo/t=
vd17HoV09U2dPcY6XfzaxLm3K2ITBkrwCLcB/s1600/Simplify%2Brules%2Bfor%2Bvirtual=
%2Binheritance.png>
>
>
> and the following code:
>
>     class VirtualBase
>     {
>     public:
>        VirtualBase(std::string & str)
>        {
>
>        }
>     };
>
>     class Derived0 : virtual public VirtualBase
>     {
>     public:
>        Derived0(std::string & str)
>           : VirtualBase(str)
>        {
>
>        }
>     };
>
>     class Derived1 : virtual public VirtualBase
>     {
>     public:
>        Derived1(std::string & str)
>           : VirtualBase(str)
>        {
>
>        }
>     };
>
>     class ComposedDerived
>        : public Derived0
>        , public Derived1
>     {
>     public:
>        ComposedDerived(std::string & str)
>           : Derived0(str)
>           , Derived1(str)
>           , VirtualBase(str)
>        {
>
>        }
>     };
>
> Let's inherit from ComposedDerived again:
>
>     class ComposedDerivedDerived
>        : public ComposedDerived
>        , public NewClass
>     {
>     public:
>        ComposedDerivedDerived(std::string & str)
>          : VirtualBase(str)
>        {
>
>        }
>     };
>
> I want to simplify it like the following:
>
>     class ComposedDerivedDerived
>        : public ComposedDerived
>        , public NewClass
>     {
>     public:
>        ComposedDerivedDerived(std::string & str) // Here is no=20
> VirtualBase(str)
>        {
>
>        }
>     };
>
> *Proposal is the following:*
>    *Require to specify constructor for VirtualBase only if compiler find=
=20
> more the one path of virtual inheritance like for C3 (on diagram) or=20
> ComposedDerived (in code) classes*
>

--=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/1b33375c-526b-4e20-a691-a85d512fa4a8%40isocpp.or=
g.

------=_Part_714_1735362021.1489928824934
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">To share my view more clear I have added a new picture:<di=
v><br></div><p class=3D"separator" style=3D"text-align: center; clear: both=
;"><a imageanchor=3D"1" href=3D"https://lh3.googleusercontent.com/-K-Qmdj7-=
vio/WM6CYV4X4OI/AAAAAAAAFRE/VgMpfnwSEQcIrdxPaMU9nlUJksrijhrpQCLcB/s1600/Sim=
plify%2Brules%2Bfor%2Bvirtual%2Binheritance.png" style=3D"margin-left: 1em;=
 margin-right: 1em;"><img src=3D"https://lh3.googleusercontent.com/-K-Qmdj7=
-vio/WM6CYV4X4OI/AAAAAAAAFRE/VgMpfnwSEQcIrdxPaMU9nlUJksrijhrpQCLcB/s320/Sim=
plify%2Brules%2Bfor%2Bvirtual%2Binheritance.png" border=3D"0" style=3D"" wi=
dth=3D"257" height=3D"320"></a></p><div><br><br>=D1=81=D1=83=D0=B1=D0=B1=D0=
=BE=D1=82=D0=B0, 18 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2017 =D0=B3., 21:31:32 U=
TC+2 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=
=8C Denis Kotov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr"><p style=3D"clear:both">Hi ev=
eryone,</p><p style=3D"clear:both"><br></p><p style=3D"clear:both">My propo=
sal is to simplify virtual inheritance rules. Consider the following class =
hierarchy:</p><div><br></div><p style=3D"text-align:center;clear:both"><a h=
ref=3D"https://lh3.googleusercontent.com/-h-cp0qNBSRI/WM2Ks4N6-3I/AAAAAAAAF=
Qo/tvd17HoV09U2dPcY6XfzaxLm3K2ITBkrwCLcB/s1600/Simplify%2Brules%2Bfor%2Bvir=
tual%2Binheritance.png" style=3D"margin-left:1em;margin-right:1em" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://lh3.go=
ogleusercontent.com/-h-cp0qNBSRI/WM2Ks4N6-3I/AAAAAAAAFQo/tvd17HoV09U2dPcY6X=
fzaxLm3K2ITBkrwCLcB/s1600/Simplify%2Brules%2Bfor%2Bvirtual%2Binheritance.pn=
g&#39;;return true;" onclick=3D"this.href=3D&#39;https://lh3.googleusercont=
ent.com/-h-cp0qNBSRI/WM2Ks4N6-3I/AAAAAAAAFQo/tvd17HoV09U2dPcY6XfzaxLm3K2ITB=
krwCLcB/s1600/Simplify%2Brules%2Bfor%2Bvirtual%2Binheritance.png&#39;;retur=
n true;"><img src=3D"https://lh3.googleusercontent.com/-h-cp0qNBSRI/WM2Ks4N=
6-3I/AAAAAAAAFQo/tvd17HoV09U2dPcY6XfzaxLm3K2ITBkrwCLcB/s320/Simplify%2Brule=
s%2Bfor%2Bvirtual%2Binheritance.png" border=3D"0" width=3D"261" height=3D"3=
20"></a></p><div><br></div><br><div>and the following code:</div><div><br><=
/div><div><div>=C2=A0 =C2=A0 class VirtualBase</div><div>=C2=A0 =C2=A0 {</d=
iv><div>=C2=A0 =C2=A0 public:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0VirtualB=
ase(std::string &amp; str)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0{</div><div=
><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0 };</di=
v><div><br></div><div>=C2=A0 =C2=A0 class Derived0 : virtual public Virtual=
Base</div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 public:</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0Derived0(std::string &amp; str)</div><div>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : VirtualBase(str)</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0{</div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0}</div><div=
>=C2=A0 =C2=A0 };</div><div><br></div><div>=C2=A0 =C2=A0 class Derived1 : v=
irtual public VirtualBase</div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0=
 public:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0Derived1(std::string &amp; st=
r)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : VirtualBase(str)</div><di=
v>=C2=A0 =C2=A0 =C2=A0 =C2=A0{</div><div><br></div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0}</div><div>=C2=A0 =C2=A0 };</div><div><br></div><div>=C2=A0 =C2=
=A0 class ComposedDerived</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0: public Der=
ived0</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0, public Derived1</div><div>=C2=
=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 public:</div><div>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0ComposedDerived(std::string &amp; str)</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 : Derived0(str)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 , Derived1(str)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 , VirtualB=
ase(str)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0{</div><div><br></div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0 };</div></div><div><br=
></div><div>Let&#39;s inherit from ComposedDerived again:</div><div><br></d=
iv><div><div>=C2=A0 =C2=A0 class ComposedDerivedDerived</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0: public ComposedDerived</div><div>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0, public NewClass<br></div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=
=A0 public:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0ComposedDerivedDerived(std=
::<wbr>string &amp; str)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: Virt=
ualBase(str)<br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0{</div><div><br></div=
><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0 };</div></div><d=
iv><br></div><div>I want to simplify it like the following:</div><div><div>=
<br></div><div><div>=C2=A0 =C2=A0 class ComposedDerivedDerived</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0: public ComposedDerived</div><div>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0, public NewClass</div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0 =
=C2=A0 public:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0ComposedDerivedDerived(=
std::<wbr>string &amp; str) // Here is no VirtualBase(str)</div><div>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0{</div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
}</div><div>=C2=A0 =C2=A0 };</div></div></div><div><br></div><div><span sty=
le=3D"background-color:rgb(255,255,0)"><b>Proposal is the following:</b></s=
pan></div><div>=C2=A0 =C2=A0<b>Require to specify constructor for VirtualBa=
se only if compiler find more the one path of virtual inheritance like for =
C3 (on diagram) or ComposedDerived (in code) classes</b></div></div></block=
quote></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/1b33375c-526b-4e20-a691-a85d512fa4a8%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/1b33375c-526b-4e20-a691-a85d512fa4a8=
%40isocpp.org</a>.<br />

------=_Part_714_1735362021.1489928824934--

------=_Part_713_2045404918.1489928824934--

.
