220 39424 <08e4fce4-e6c6-4dc2-a9ca-098f1ed8b380@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Contract attributes and trailing return types
Date: Thu, 26 Jul 2018 15:01:18 -0700 (PDT)
Lines: 70
Approved: news@gmane.org
Message-ID: <08e4fce4-e6c6-4dc2-a9ca-098f1ed8b380@isocpp.org>
References: <b39be2a8-c0c4-4887-a4ad-d11a50107aa9@isocpp.org>
 <CALmDwq3o0_8STpgWt6NVQ1eejD-krUefpJkk=rDmkOK-co-1LQ@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_416_1472954731.1532642479039"
X-Trace: blaine.gmane.org 1532642358 6873 195.159.176.226 (26 Jul 2018 21:59:18 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 26 Jul 2018 21:59:18 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBL4J5HNAKGQEITL5NRA@isocpp.org Thu Jul 26 23:59:14 2018
Return-path: <std-proposals+bncBCEKFTV6ZUMBBL4J5HNAKGQEITL5NRA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f198.google.com ([209.85.161.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBL4J5HNAKGQEITL5NRA@isocpp.org>)
	id 1fioHu-0001ec-9J
	for gclcip-std-proposals@m.gmane.org; Thu, 26 Jul 2018 23:59:10 +0200
Original-Received: by mail-yw0-f198.google.com with SMTP id 2-v6sf1615077ywn.13
        for <gclcip-std-proposals@m.gmane.org>; Thu, 26 Jul 2018 15:01:21 -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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=XhcNcFM2uo4l4mBMt7a6nb4wE7A05kxiXxzklm8/FKk=;
        b=XBQvN7+9HyV4mCbvXy/xC+8OjaSlUFyiUyvtNDoum7mx2v0hNeoPABzcjitoWdkSvH
         UCvGVBaA8fQFuIHmAcmoPm/XqYUJlEP5FI8kyL71y0z+29EIN3uNrNh3j8KeAnCeEgK6
         lfSrndjt97ERHQ8uID4e5ZO7rLfElyxfp5/U0x8QILG0XFZz+oH3Em5YjQAO7L5cZmzK
         Lqp1s/ThhsbleQK2q9bgXZSJ61JnIBA76mRAjHtKTVoXVFv5XIE3G5CrtN9ZhXIYNSwn
         /40moiZerfpnA7uwYgvtKIRLgzbDu8G+/fQD1ELMMrIeYbx4NLizEIleTLja4aQdRcrd
         Ap2w==
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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=XhcNcFM2uo4l4mBMt7a6nb4wE7A05kxiXxzklm8/FKk=;
        b=qjqsTrXGto/yw+k+u9rFuHzIV3ldJS+Zgo/4FZDczG+II5/CFq3mBqeZmrsCILQHu4
         GE1yrLZO5gMEtb1sL3asPzznWe7mpa5ZZMkZGldMgJSjlBHOsqjyURVfSrfcliLkBD6R
         4KT480Bg1ZFItzlBnTMOD/c9bJkQgD2jxykNgLl7B622KysM1Um3z30u/Djfk72cFbFy
         iDzzvNbkoqbn6ingORbergl7CG3UiF4LlkZZfscP2v39STVhTvpmVSJjVH+jAgxmoAya
         KnYWOmgceakTHC9eVkaT2RusveBdsztVuEJ0ExH2GwRd05SCd1qA+4Vh71dYh6KNkvIn
         nqDw==
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=XhcNcFM2uo4l4mBMt7a6nb4wE7A05kxiXxzklm8/FKk=;
        b=Ju0EpzgHOOHCCBL3KkReyopBv1MxWtaEWuz56wj8gVVWTG1HH6DzhdDKKbawrVEHEb
         aRw1CqR5wzh8kL40hYE4reePbZmntDql+JZ9WG4KYtf0RSk7XzD+tHPo2AHQ4KALP98m
         DPqPT1ej6NpvFC3Jr+VjYbxnPlid/bBzuAgK5OMSKcb893JSIVnOONw+qeo/DA5DvLPY
         Go/6PRvWtf/Vn/nrmFsWvSp1wMfNG2q2I60erqnD2mU7zVsvjW8uBad3AgeBF199bErs
         aTOevA9BVGwy59s582Y6e4PwxmQV8tAD3psvNqhG81jlG7W0M8mjXs3TAxqYwZAUvntL
         aakA==
X-Gm-Message-State: AOUpUlHW5DCfsfEs5Wn61FgI0jWjXOFwiG4T37gmJRawjihouOvFcAyz
	ldys92qoWocHC+3YxaBScgN/Tg==
X-Google-Smtp-Source: AAOMgpcT9L7v/tW8eWxnBO1pURRoIyTRWu4ymLZuVpByh2SPTZ6RP+oQvg0PPOF2yVA60XCVegk0cQ==
X-Received: by 2002:a81:128d:: with SMTP id 135-v6mr1057920yws.28.1532642480831;
        Thu, 26 Jul 2018 15:01:20 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:9b97:: with SMTP id s145-v6ls266714ywg.43.gmail; Thu, 26
 Jul 2018 15:01:19 -0700 (PDT)
X-Received: by 2002:a81:3807:: with SMTP id f7-v6mr42243ywa.4.1532642479538;
        Thu, 26 Jul 2018 15:01:19 -0700 (PDT)
In-Reply-To: <CALmDwq3o0_8STpgWt6NVQ1eejD-krUefpJkk=rDmkOK-co-1LQ@mail.gmail.com>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:39424
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39424>

------=_Part_416_1472954731.1532642479039
Content-Type: multipart/alternative; 
	boundary="----=_Part_417_135283010.1532642479039"

------=_Part_417_135283010.1532642479039
Content-Type: text/plain; charset="UTF-8"



On Thursday, July 26, 2018 at 5:49:24 PM UTC-4, Nicolas Lesser wrote:
>
> Attributes with trailing return type generally suffer from this problem:
>
> auto f(int x, int y) [[deprecated]] -> int;
>
> If you don't mind, you can put the contracts before, just like we normally 
> do with attributes:
>
> [[expects: x>0]]
> [[expects: y!=0]]
> [[ensures result: result > x+y]]
> auto f(int x, int y) -> int;
>

Not according to P0542. Contracts "appertain to the function type", so they 
can't be prefixed.

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/08e4fce4-e6c6-4dc2-a9ca-098f1ed8b380%40isocpp.org.

------=_Part_417_135283010.1532642479039
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Thursday, July 26, 2018 at 5:49:24 PM UTC-4, Ni=
colas Lesser wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr">Attributes with trailing return type generally suffer from this probl=
em:<div><br></div><div>auto f(int x, int y) [[deprecated]] -&gt; int;</div>=
<div><br></div><div>If you don&#39;t mind, you can put the contracts before=
, just like we normally do with attributes:</div><div><br></div><div><div>[=
[expects: x&gt;0]]</div><div>[[expects: y!=3D0]]</div><div>[[ensures result=
: result &gt; x+y]]</div></div><div>auto f(int x, int y) -&gt; int;</div></=
div></blockquote><div><br></div><div>Not according to P0542. Contracts &quo=
t;appertain to the function type&quot;, so they can&#39;t be prefixed.</div=
><br></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/08e4fce4-e6c6-4dc2-a9ca-098f1ed8b380%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/08e4fce4-e6c6-4dc2-a9ca-098f1ed8b380=
%40isocpp.org</a>.<br />

------=_Part_417_135283010.1532642479039--

------=_Part_416_1472954731.1532642479039--

.
