220 17295 <1689946.eYtMPifRN2@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: noexcept(auto)
Date: Tue, 07 Apr 2015 08:01:16 -0700
Lines: 43
Approved: news@gmane.org
Message-ID: <1689946.eYtMPifRN2@tjmaciei-mobl4>
References: <1657285.u9ziYB6mWs@tjmaciei-mobl4> <CADvuK0+751LdPbEVMngEFTCF-sZyDxDb7t1++oto_5CuJnh5zg@mail.gmail.com> <CAD6_Qj8nsT7VrkMdMkvWgFs_zFUGA3-8o8+am_7FEqD42z9mLA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1428418893 5945 80.91.229.3 (7 Apr 2015 15:01:33 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 7 Apr 2015 15:01:33 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBRPCR6UQKGQE2GSZSBI@isocpp.org Tue Apr 07 17:01:26 2015
Return-path: <std-proposals+bncBCB4TK757YBRBRPCR6UQKGQE2GSZSBI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f71.google.com ([209.85.215.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBRPCR6UQKGQE2GSZSBI@isocpp.org>)
	id 1YfV0I-0005LC-IA
	for gclcip-std-proposals@m.gmane.org; Tue, 07 Apr 2015 17:01:26 +0200
Original-Received: by labgx2 with SMTP id gx2sf13698387lab.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 07 Apr 2015 08:01:26 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:content-transfer-encoding
         :content-type:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=Or7i+qvegQWppapQWs/jUzTizWGkdQbUQpnNbimjwjU=;
        b=X88bAkTXA4i0B+3gitaqlp8YVH102UxDRgoByi7VfZbw4Y7n2ie+Mdg79724z1WkoF
         24mwxpp+a7/1CclLu9ISk74nykcqESj/tfIC2JMHv+xk9xxwe2IbFjxOw2P2Q7LdUKVR
         eni4w2MZNBq88VnigIRThRi6fo+Td7zOq8NfG0eBHtnLg7TWkCp/d7/aXLnsw4u3J/UY
         qoGF/1thOe+P56HdP1oJbK3lY4pyRaIIwTW+PNBs4fSa8EM2Ljp0Emx8GTSwfznXSTxt
         /TlISWqoPohYNCsflpWitwtQ6jyFqOrmvNEHp1SYa2F4YlWp0wgTnZgE1zW8nr+7f2ss
         bV5 
X-Gm-Message-State: ALoCoQlgGjeAn9mrY6vaBmjswtwXhtWNx/4MNNgo2G2hGYAyZOzy5esnkX1jhxhqq2kjHSkx5XrE
X-Received: by 10.194.11.70 with SMTP id o6mr4218434wjb.6.1428418885945;
        Tue, 07 Apr 2015 08:01:25 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.100.133 with SMTP id ey5ls53492wib.32.canary; Tue, 07 Apr
 2015 08:01:24 -0700 (PDT)
X-Received: by 10.194.109.9 with SMTP id ho9mr40178860wjb.29.1428418884943;
        Tue, 07 Apr 2015 08:01:24 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id db1si13281394wib.84.2015.04.07.08.01.23
        for <std-proposals@isocpp.org>;
        Tue, 07 Apr 2015 08:01:23 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) client-ip=78.47.120.188;
Original-Received: from tjmaciei-mobl4.localnet (unknown [IPv6:2601:7:1c80:b36:30eb:baa0:5206:8ce4])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 6D94111BAFB
	for <std-proposals@isocpp.org>; Tue,  7 Apr 2015 08:01:23 -0700 (PDT)
User-Agent: KMail/4.14.6 (Linux/3.19.3-1-desktop; KDE/4.14.6; x86_64; ; )
In-Reply-To: <CAD6_Qj8nsT7VrkMdMkvWgFs_zFUGA3-8o8+am_7FEqD42z9mLA@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mail=thiago@macieira.org
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:17295
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/17295>

On Tuesday 07 April 2015 11:41:35 David Rodr=C3=ADguez Ibeas wrote:
> void reset_element(std::vector<int> & v, size_t index) {
>     if (index < v.size()) v.at(index) =3D 0;
> }
>=20
> The compiler sees the call to 'v.at' and would assume the function to be
> 'noexcept(false)', but it is really 'noexcept(true)', it is guaranteed no=
t
> to throw. While the example is crappy, it represents a whole family of
> functions that can call on 'noexcept(false)' functions but for which the
> code ensures that no exception will be really thrown.
>=20
> I am in favor of using 'auto' as a short hand for "deduce it for me" (or =
at
> the very least not against it), but I don't really think that the compile=
r
> should be injecting noexcept declarations for the programmer implictly.
> Those "magic 14 characters" are really the user requesting that the
> compiler to do it.

In this example, without the magic, the code is noexcept(false). So if the=
=20
compiler deduces as false again, there's no loss.

If you need to tell the compiler otherwise, you still can.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=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/.

.
