220 12976 <CAOHCbit1rDgJ3zna1i1Mwn49UOv3SLHkS2NyCyrn3jk3=Q8xYw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Tony V E <tvaneerd@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Idea for new contextual keyword
Date: Thu, 18 Sep 2014 11:12:42 -0400
Lines: 86
Approved: news@gmane.org
Message-ID: <CAOHCbit1rDgJ3zna1i1Mwn49UOv3SLHkS2NyCyrn3jk3=Q8xYw@mail.gmail.com>
References: <2ff42d9d-16df-4040-8ae1-0a17d4f78d97@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e0158ad547cc9aa0503586a7a
X-Trace: ger.gmane.org 1411053172 31308 80.91.229.3 (18 Sep 2014 15:12:52 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 18 Sep 2014 15:12:52 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQIOX3HLUACRUBATVMNOO@isocpp.org Thu Sep 18 17:12:45 2014
Return-path: <std-proposals+bncBCUZ5QWKNQIOX3HLUACRUBATVMNOO@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f71.google.com ([74.125.83.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIOX3HLUACRUBATVMNOO@isocpp.org>)
	id 1XUdO0-0006UI-RW
	for gclcip-std-proposals@m.gmane.org; Thu, 18 Sep 2014 17:12:44 +0200
Original-Received: by mail-ee0-f71.google.com with SMTP id e53sf748323eek.10
        for <gclcip-std-proposals@m.gmane.org>; Thu, 18 Sep 2014 08:12:44 -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=UlOI2tyw68nrgVc81gSYpTK5MlzZGIKm6otqNS6ghHI=;
        b=NN18+c8YIRc5JAUgEMiXSFyE8JARB7b61pqRf7bm1DHFXeadzMf7SrGVW/NDAPXyEO
         YH7JW29C9u7T389daNMQ6o5NPsgFiGydupiFIr5YI/tWAdJJEc4WeCgo1ypVG5g3lkxL
         T37GXbTv0Yr+eRz61ONeRWkHyasECTV7ipzM/GJXBkHjgbbWzaQmOnne2ZHfJ1VqyGCN
         9CxpyyF7aM/JjkS3SB/CqR+hgYFDvRucioHZhPPKBEouhaRFfMQIRU4BbdVnO0+NeNi0
         4/uoAFCI0Ou7nE8wXt/79Pknl7TN3bXq1avlHdLWU/zuKMt41g0wEqt2ndltXp4O09+T
         8Z9Q==
X-Gm-Message-State: ALoCoQm/9tP901HnnvIfRN/rzmqr1eRV/s2zs9aixl0LNgNxEiiq9poTAy21WMobYkvg59pBKDEI
X-Received: by 10.112.190.102 with SMTP id gp6mr625486lbc.10.1411053164412;
        Thu, 18 Sep 2014 08:12:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.246.35 with SMTP id xt3ls214089lac.67.gmail; Thu, 18 Sep
 2014 08:12:42 -0700 (PDT)
X-Received: by 10.152.170.167 with SMTP id an7mr366408lac.94.1411053162567;
        Thu, 18 Sep 2014 08:12:42 -0700 (PDT)
Original-Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [2a00:1450:4010:c04::22e])
        by mx.google.com with ESMTPS id qi3si33255624lbb.41.2014.09.18.08.12.42
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 18 Sep 2014 08:12:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 2a00:1450:4010:c04::22e as permitted sender) client-ip=2a00:1450:4010:c04::22e;
Original-Received: by mail-lb0-f174.google.com with SMTP id l4so1361818lbv.33
        for <std-proposals@isocpp.org>; Thu, 18 Sep 2014 08:12:42 -0700 (PDT)
X-Received: by 10.152.21.168 with SMTP id w8mr245024lae.59.1411053162120; Thu,
 18 Sep 2014 08:12:42 -0700 (PDT)
Original-Received: by 10.112.75.199 with HTTP; Thu, 18 Sep 2014 08:12:42 -0700 (PDT)
In-Reply-To: <2ff42d9d-16df-4040-8ae1-0a17d4f78d97@isocpp.org>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of tvaneerd@gmail.com designates 2a00:1450:4010:c04::22e as permitted
 sender) smtp.mail=tvaneerd@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=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: <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>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:12976
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/12976>

--089e0158ad547cc9aa0503586a7a
Content-Type: text/plain; charset=UTF-8

On Wed, Sep 17, 2014 at 7:27 PM, Leor Zolman <leorzolman@gmail.com> wrote:

> Hi all,
> This is my first-ever attempt at initiating a proposal; I look forward to
> the process.
>
> I think there's gaping hole in C++ that permits (or, more importantly,
> prevents the class designer from prohibiting) the redefinition/hiding of a
> non-virtual  function. As Scott Meyers says in items 35 and 36 of *Effective
> C++ (3rd Ed.)*, non-virtual functions are supposed to represent *invariants
> over specialization*. Yet, C++ currently offers no mechanism whereby a
> function can be flagged explicitly as "not to be redefined."
>
> Following some great conversations at CppCon (the most illuminating being
> one I had with stl), I'd like to propose a new contextual keyword that
> would be closely related to final/override (and written similarly.) The
> best name I've been able to think of so far for this new keyword is
> "invariant."
>
> Since 'final' only applies to virtual functions, 'invariant' would only be
> applicable to non-virtual functions, and make it an error to redefine the
> function in a derived class.
>


Why not just reuse 'final' then?

Tony

-- 

--- 
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/.

--089e0158ad547cc9aa0503586a7a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Sep 17, 2014 at 7:27 PM, Leor Zolman <span dir=3D"ltr">&lt;<a h=
ref=3D"mailto:leorzolman@gmail.com" target=3D"_blank">leorzolman@gmail.com<=
/a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi=
 all,<br>This is my first-ever attempt at initiating a proposal; I look for=
ward to the process.<br><br>I think there&#39;s gaping hole in C++ that per=
mits (or, more importantly, prevents the class designer from prohibiting) t=
he redefinition/hiding of a non-virtual=C2=A0 function. As Scott Meyers say=
s in items 35 and 36 of <i>Effective C++ (3rd Ed.)</i>, non-virtual functio=
ns are supposed to represent <i>invariants over specialization</i>. Yet, C+=
+ currently offers no mechanism whereby a function can be flagged explicitl=
y as &quot;not to be redefined.&quot; <br><br>Following some great conversa=
tions at CppCon (the most illuminating=20
being one I had with stl), I&#39;d like to propose a new contextual keyword=
 that=20
would be closely related to final/override (and written similarly.) The bes=
t name I&#39;ve been able to think of so far for this new keyword is &quot;=
invariant.&quot;<br><br>Since &#39;final&#39; only applies to virtual funct=
ions, &#39;invariant&#39; would only be applicable to non-virtual functions=
, and make it an error to redefine the function in a derived class. <br></d=
iv></blockquote><div><br></div><div><br>Why not just reuse &#39;final&#39; =
then?<br><br></div><div>Tony<br><br></div><br></div><br></div></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 />

--089e0158ad547cc9aa0503586a7a--

.
