220 13239 <CA+cyFgvCqVYas2W4vzWMx0oDxgoJw6p9tTaZJh3PtjqFLD-6rg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "'Geoffrey Romer' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Tighten rules for virtual override keyword combination
Date: Sat, 27 Sep 2014 22:50:51 -0700
Lines: 108
Approved: news@gmane.org
Message-ID: <CA+cyFgvCqVYas2W4vzWMx0oDxgoJw6p9tTaZJh3PtjqFLD-6rg@mail.gmail.com>
References: <19267205-7e26-4c12-b9b4-f26ab2f99eb7@isocpp.org>
	<803262EF-88B4-40B0-AC9B-7C7356CDE56A@gmail.com>
	<fa6760c6-0adc-4fca-9dad-2bfca08f19de@isocpp.org>
	<54274B57.6040007@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c2fad0948494050419bb1a
X-Trace: ger.gmane.org 1411883461 3438 80.91.229.3 (28 Sep 2014 05:51:01 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 28 Sep 2014 05:51:01 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD74DCN5SYHBBO6DT2QQKGQEXWOG5AY@isocpp.org Sun Sep 28 07:50:54 2014
Return-path: <std-proposals+bncBD74DCN5SYHBBO6DT2QQKGQEXWOG5AY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD74DCN5SYHBBO6DT2QQKGQEXWOG5AY@isocpp.org>)
	id 1XY7Nl-0005A6-Ej
	for gclcip-std-proposals@m.gmane.org; Sun, 28 Sep 2014 07:50:53 +0200
Original-Received: by mail-ie0-f199.google.com with SMTP id rl12sf6366229iec.6
        for <gclcip-std-proposals@m.gmane.org>; Sat, 27 Sep 2014 22:50:52 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=7k2Sj10Am9v5zhIr+YC6q6mowyik+wXdV9H1358OlXU=;
        b=i5hF0YJaFgwRS2HjxrzCNmY+zFxpB+pXddUVpBpcSUhOf0/fDTL8YCYLXuCt9jtd6r
         SSN6N0gvtwrMfvEFpHcv9tsbVCb+GZ5W3O5E1lyvAPePlCgb+y+LWKSAr36y6Mg6xv/n
         uZKeq7M6CSts9j+jXnHIjpSO4hhuJ7sG7wDa2QokDEpmsxsUhMryr3z+RGWvT356n01w
         tZ2hZCUtImWPEbeg38MesVOGegpK+ohC7mbQmChSt03QbZIN2/kOloy7yWOhujwRRkFR
         CCeLQKTEkqtBtFH7GuBUia7xKk5p3GuDMZ4fpkq8Cfgq8GZUyXKc/Ur1p4EZrwkdsCPy
         7w1A==
X-Gm-Message-State: ALoCoQle+Ky5gisENTXebNpYVecINQIheDeMev4mafiynPwunrcSVcBI+xB4xW7yR4mZZ61YLyZV
X-Received: by 10.182.95.40 with SMTP id dh8mr28162165obb.11.1411883452504;
        Sat, 27 Sep 2014 22:50:52 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.130.229 with SMTP id oh5ls981184obb.88.gmail; Sat, 27 Sep
 2014 22:50:51 -0700 (PDT)
X-Received: by 10.60.45.7 with SMTP id i7mr33044048oem.2.1411883451634;
        Sat, 27 Sep 2014 22:50:51 -0700 (PDT)
Original-Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [2607:f8b0:4003:c01::230])
        by mx.google.com with ESMTPS id i4si14304213obh.74.2014.09.27.22.50.51
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 27 Sep 2014 22:50:51 -0700 (PDT)
Received-SPF: pass (google.com: domain of gromer@google.com designates 2607:f8b0:4003:c01::230 as permitted sender) client-ip=2607:f8b0:4003:c01::230;
Original-Received: by mail-ob0-f176.google.com with SMTP id vb8so2452746obc.21
        for <std-proposals@isocpp.org>; Sat, 27 Sep 2014 22:50:51 -0700 (PDT)
X-Received: by 10.182.236.225 with SMTP id ux1mr31246982obc.57.1411883451304;
 Sat, 27 Sep 2014 22:50:51 -0700 (PDT)
Original-Received: by 10.76.68.42 with HTTP; Sat, 27 Sep 2014 22:50:51 -0700 (PDT)
Original-Received: by 10.76.68.42 with HTTP; Sat, 27 Sep 2014 22:50:51 -0700 (PDT)
In-Reply-To: <54274B57.6040007@gmail.com>
X-Original-Sender: gromer@google.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gromer@google.com designates 2607:f8b0:4003:c01::230 as permitted
 sender) smtp.mail=gromer@google.com;       dkim=pass header.i=@google.com;
       dmarc=pass (p=REJECT dis=NONE) header.from=google.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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
X-Original-From: Geoffrey Romer <gromer@google.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:13239
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13239>

--001a11c2fad0948494050419bb1a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Note that in the case of 'final', the presence or absence of 'virtual'
makes an important semantic difference: without the 'virtual', it behaves
like 'override', so you get an error if it doesn't override a virtual
method in the base class. Adding 'virtual' suppresses that error, which is
almost never what you want. This makes "use exactly one of the three" a
pretty good rule of thumb.
Le 28/09/2014 01:21, Myriachan a =C3=A9crit :

> I actually wish C++ had required that overrides used the virtual
> keywords.  It's nice to be able to look at the class and know what is goi=
ng
> to behave polymorphically.  override at the end would distinguish them,
> sure, but then I'd have to look at the left and right side of each line
> instead of just the left.
>
Well, actually i prefer not to mix virtual and override, because they give
me different informations :
- when i see virtual, i know it's the base definition
- when i see override, i know it's a redefinition.
If i were to mix them, i would be misled by the virtual at left, unless i
checked the right part for some override...

--=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
email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-
proposals/.

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a11c2fad0948494050419bb1a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">Note that in the case of &#39;final&#39;, the presence or ab=
sence of &#39;virtual&#39; makes an important semantic difference: without =
the &#39;virtual&#39;, it behaves like &#39;override&#39;, so you get an er=
ror if it doesn&#39;t override a virtual method in the base class. Adding &=
#39;virtual&#39; suppresses that error, which is almost never what you want=
.. This makes &quot;use exactly one of the three&quot; a pretty good rule of=
 thumb.</p>
<div class=3D"gmail_quot&lt;blockquote class=3D" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">Le 28/09/2014 01:21, Myriacha=
n a =C3=A9crit :<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
I actually wish C++ had required that overrides used the virtual keywords.=
=C2=A0 It&#39;s nice to be able to look at the class and know what is going=
 to behave polymorphically.=C2=A0 override at the end would distinguish the=
m, sure, but then I&#39;d have to look at the left and right side of each l=
ine instead of just the left.<br>
</blockquote>
Well, actually i prefer not to mix virtual and override, because they give =
me different informations :<br>
- when i see virtual, i know it&#39;s the base definition<br>
- when i see override, i know it&#39;s a redefinition.<br>
If i were to mix them, i would be misled by the virtual at left, unless i c=
hecked the right part for some override...<br>
<br>
-- <br>
<br>
--- You received this message because you are subscribed to the Google Grou=
ps &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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<u></u>isocpp.=
org/group/std-<u></u>proposals/</a>.<br>
</div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c2fad0948494050419bb1a--

.
