220 31681 <2340e1b0-09bd-4f5b-bf15-7605eaed858b@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: Sat, 18 Mar 2017 14:18:26 -0700 (PDT)
Lines: 166
Approved: news@gmane.org
Message-ID: <2340e1b0-09bd-4f5b-bf15-7605eaed858b@isocpp.org>
References: <6aa2e439-345e-4f04-8843-f38bb7b825b2@isocpp.org>
 <CAFk2RUZgeRfv4zYnc+y_Cw1-1onyj-725pq-UUizv8GVm8KQCQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_616_1307519651.1489871906742"
X-Trace: blaine.gmane.org 1489871909 3316 195.159.176.226 (18 Mar 2017 21:18:29 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 18 Mar 2017 21:18:29 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDY2PNGE6QOBBI6IW3DAKGQETX5DGBY@isocpp.org Sat Mar 18 22:18:25 2017
Return-path: <std-proposals+bncBDY2PNGE6QOBBI6IW3DAKGQETX5DGBY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f72.google.com ([74.125.83.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDY2PNGE6QOBBI6IW3DAKGQETX5DGBY@isocpp.org>)
	id 1cpLjy-00005I-Gn
	for gclcip-std-proposals@m.gmane.org; Sat, 18 Mar 2017 22:18:22 +0100
Original-Received: by mail-pg0-f72.google.com with SMTP id 21sf40063441pgg.4
        for <gclcip-std-proposals@m.gmane.org>; Sat, 18 Mar 2017 14:18:28 -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=LBpqFT4sD6UHuiEkUtCGXwTNHvXLrUnbLsI0Vh+ifGc=;
        b=K4/LhmcpiIb4+tuqi4DyCYKJcfSgzvt2bl7OXNWSeM21+WMrD7Z5oSIlZhaBNa89lG
         EEAlBpA7UGFkd14ugLBpGgYSSEal+WxMbUUBmI4mLTXXHXdYLbarMicNADHved9VkEMQ
         aJSo2ZwgKtvQpbzT4hMAm0mQIdsVRBTt23lD31Pjbm6IrmpkcFcLY9GWyiUJju1dso/F
         eyJ1xwKDiodOMejj3Tvv7TGHYZtOmib3lh9BlafI82rXxmskJe8v0/bba2M632Vs24Zo
         Y7Jud5F1YOmMyF8vtSo0ooAwVNB/8itsfSnKlM5vewAdLGxBEjcNmfdkGxt8649qBagy
         lvjQ==
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=LBpqFT4sD6UHuiEkUtCGXwTNHvXLrUnbLsI0Vh+ifGc=;
        b=Y43Nicq0Va6xVhAePJQepNHBBMRDDasqS8cvr12/FMI16FYs91OcFT9u0qvGZvsoI0
         kCFSWUEDQUbQbtnFF0SZ6ZHHHa/wSyXBNOnN1/Em+gA9BSVT9RzmBA5Gr+lgrHUhBfyB
         ofK/xioz71qLJEut8k5E7Mo2/wFUIz5/sNGSuKGDwflfqovPV57kMMAaSm8ONO3yvHC5
         eZ76WBlU8CK3SrtnKYf8dg1zXr8ciITE1UX6oYOrEpw15Gh++pm9aP3c7ZeoxRriuf2o
         TluN70Jq4vlejP1CrhlYboheAfG7R+43z06hzWekpboIWAieydJNmn01srZ++g5ZZgdn
         +Zzw==
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=LBpqFT4sD6UHuiEkUtCGXwTNHvXLrUnbLsI0Vh+ifGc=;
        b=aOK9iy5ddlyhngu43e00KUe+Aml+SN+TBgLyU9hJKybgHfgtxUhC8m82+iduHXTAQK
         SZahW1KgTixR08cqpjDNCGVqb51slgLd0WoteKIKMK+Z2EbeRhCyDpbOf5OAzL1xF8wB
         QW3dg1hWXCMMDT9t9nK1Q4oAaQrGGXON253zPuIPkrE37R//fI5OKV3JaHE5RAjAdid+
         AxtDsuASTYJI2sBNE6LvMqSPM9xv9r07iImnXP4mXqiVw66S8Vxi/7+FvxE5dAgsVxrx
         68TUtpmqTaHqX5D1xNPUyaFPjVwalKyhEdr2/mTmrLM1su6PA1fT3VNKkTNjvU8nhaGk
         q2rQ==
X-Gm-Message-State: AFeK/H2++NYZPlCEfPKR/ikURYfzUbLRy00uVOqjs3VIrkm+TImc40zUemlS0+oS1kBRmQ==
X-Received: by 10.99.61.79 with SMTP id k76mr11077516pga.3.1489871908115;
        Sat, 18 Mar 2017 14:18:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.59.194 with SMTP id k60ls7854813otc.34.gmail; Sat, 18 Mar
 2017 14:18:27 -0700 (PDT)
X-Received: by 10.157.22.200 with SMTP id s8mr2317292ots.16.1489871907213;
        Sat, 18 Mar 2017 14:18:27 -0700 (PDT)
In-Reply-To: <CAFk2RUZgeRfv4zYnc+y_Cw1-1onyj-725pq-UUizv8GVm8KQCQ@mail.gmail.com>
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:31681
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31681>

------=_Part_616_1307519651.1489871906742
Content-Type: multipart/alternative; 
	boundary="----=_Part_617_754500275.1489871906742"

------=_Part_617_754500275.1489871906742
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Yes your are right I have misspelled it. Should be something like this:

    class ComposedDerivedDerived
           : public ComposedDerived
           , public NewClass
        {
        public:
           ComposedDerivedDerived(std::string & str) // Here is no=20
VirtualBase(str)
               : ComposedDerived(str),
               , NewClass()
           {

           }
        };

But I do not see any problems with separate translation unit.
We should not care about another separate unit, it is responsibility of=20
compiler that will support this rule to require an user calls a constructor=
=20
for VirtualBase.
We should not care because according to this rule we know that constructor=
=20
had been called above.
But if user want it can call it directly for backward compitability.

VirtualBase constructor should be required to call only when class inherits=
=20
from two or more classes those inhertits virtually from VirtualBase class.

=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:45:04 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 Ville Voutilainen=20
=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
>
>
> On 18 March 2017 at 21:31, Denis Kotov <redr...@gmail.com <javascript:>>=
=20
> wrote:
>
>> 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*
>>
>
>
> ComposedDerivedDerived didn't initialize ComposedDerived in your original=
=20
> code or this modified code. Also, there's no reason that
> a compiler could find an initialization for a virtual base, since that=20
> initialization may be in a separate translation unit that the compiler=20
> doesn't
> see, so this idea doesn't work at all.
>
>

--=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/2340e1b0-09bd-4f5b-bf15-7605eaed858b%40isocpp.or=
g.

------=_Part_617_754500275.1489871906742
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yes your are right I have misspelled it. Should be somethi=
ng like this:<div><br></div><div><div>=C2=A0 =C2=A0 class ComposedDerivedDe=
rived</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: public ComposedD=
erived</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, public NewClass=
</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 public:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ComposedDeri=
vedDerived(std::<wbr>string &amp; str) // Here is no VirtualBase(str)</div>=
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: ComposedDeriv=
ed(str),</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0,=
 NewClass()</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{</div><div>=
<br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 };</div><div><br></div><div><div>But I do not see any =
problems with separate translation unit.</div><div>We should not care about=
 another separate unit, it is responsibility of compiler that will support =
this rule to require an user calls a constructor for VirtualBase.</div><div=
>We should not care because according to this rule we know that constructor=
 had been called above.</div><div>But if user want it can call it directly =
for backward compitability.</div><div><br></div><div>VirtualBase constructo=
r should be required to call only when class inherits from two or more clas=
ses those inhertits virtually from VirtualBase class.</div></div><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 201=
7 =D0=B3., 21:45:04 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 Ville Voutilainen =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=
=D0=B0=D0=BB:<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">=
<br><div><br><div class=3D"gmail_quote">On 18 March 2017 at 21:31, Denis Ko=
tov <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"i22x4yD-EQAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;">redr...@gmail.com</a>&gt;</span> wrote:<br><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex"><div dir=3D"ltr">I want to simplify it like the follo=
wing:<div><div><br></div><div><div>=C2=A0 =C2=A0 class ComposedDerivedDeriv=
ed</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=A0ComposedDe=
rivedDerived(std::<wbr>string &amp; str) // Here is no VirtualBase(str)</di=
v><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 style=3D"background-color:rgb(255,255,0)"><b>Proposal is the foll=
owing:</b></span></div><div>=C2=A0 =C2=A0<b>Require to specify constructor =
for VirtualBase only if compiler find more the one path of virtual inherita=
nce like for C3 (on diagram) or ComposedDerived (in code) classes</b></div>=
</div></blockquote><div><br><br></div><div>ComposedDerivedDerived didn&#39;=
t initialize ComposedDerived in your original code or this modified code. A=
lso, there&#39;s no reason that<br></div><div>a compiler could find an init=
ialization for a virtual base, since that initialization may be in a separa=
te translation unit that the compiler doesn&#39;t<br></div><div>see, so thi=
s idea doesn&#39;t work at all.<br></div></div><br></div></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/2340e1b0-09bd-4f5b-bf15-7605eaed858b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2340e1b0-09bd-4f5b-bf15-7605eaed858b=
%40isocpp.org</a>.<br />

------=_Part_617_754500275.1489871906742--

------=_Part_616_1307519651.1489871906742--

.
