220 17998 <CANh8DEmVOed-AybOpyLy-C6i4mc1wxUbTjCys6sTkGL48L=Qig@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "'Matt Calabrese' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: First draft: Non-copyable call wrapper, std::unique_function
Date: Tue, 19 May 2015 12:47:14 -0700
Lines: 78
Approved: news@gmane.org
Message-ID: <CANh8DEmVOed-AybOpyLy-C6i4mc1wxUbTjCys6sTkGL48L=Qig@mail.gmail.com>
References: <59ED9069-2650-44E2-B00E-0E56ED37B83D@gmail.com>
	<27a788e7-4912-4a58-8201-79138ddf15a3@isocpp.org>
	<CAGg_6+P=2BDzGGugjdAx1pKsAHxuxNyEXGi3rz-CA-st32mf0Q@mail.gmail.com>
	<e6f6357e-1206-4817-a439-4599b8da6f48@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e013a1a38bc998d0516749339
X-Trace: ger.gmane.org 1432064842 1549 80.91.229.3 (19 May 2015 19:47:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 19 May 2015 19:47:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCGNLO5F34OBBQVG52VAKGQENH2GG7I@isocpp.org Tue May 19 21:47:17 2015
Return-path: <std-proposals+bncBCGNLO5F34OBBQVG52VAKGQENH2GG7I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f197.google.com ([209.85.214.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCGNLO5F34OBBQVG52VAKGQENH2GG7I@isocpp.org>)
	id 1YunTw-0003E5-2m
	for gclcip-std-proposals@m.gmane.org; Tue, 19 May 2015 21:47:16 +0200
Original-Received: by obblk5 with SMTP id lk5sf36643809obb.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 19 May 2015 12:47:15 -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: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=xjmtR7L+MigUef8pXieI2JB1R2l+RBzE3iq69aqDQeo=;
        b=NY0ak5zMDDqzKHxIMAd1slQ88jygqAC69HtN8T27Pc3eou+LGN7rOqb6Pw7+MUXyJz
         wUyjilTRr9u91CrgvrSQvdhXlPgbEQmIDqOnPnjJjMXYsvGZ/XU5hsrxw84Ad6IE+AId
         8AoO5rJD8B7GvGhz2fsb4RaNDbEyVfhcZuNEkAf+93WkebdlHNbGbyYxwLG42Cd16mJJ
         crtxkdodBTOMmsOV9T+bOUmtJ45gMDyaDP1DmpXRVp7xjJnquCTifeowZn7jV/ixC2IZ
         1GlV57WJhkH2129iPk9Lwv6bryYzMhcVQpMX5N69osWZ3j7tWNVCyXADBngYJWWA1M8I
         Z3JQ==
X-Gm-Message-State: ALoCoQkA4EUQUCFYvP7uJanG7H4wRtGMpCeNg5sVUh5dnGSaH96ef4hTq8cBWjL5uSi6/+ncEa4L
X-Received: by 10.42.203.211 with SMTP id fj19mr54099953icb.33.1432064835059;
        Tue, 19 May 2015 12:47:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.111.78 with SMTP id ig14ls335357igb.17.gmail; Tue, 19 May
 2015 12:47:14 -0700 (PDT)
X-Received: by 10.107.40.144 with SMTP id o138mr2284181ioo.66.1432064834314;
        Tue, 19 May 2015 12:47:14 -0700 (PDT)
Original-Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com. [2607:f8b0:4001:c03::22c])
        by mx.google.com with ESMTPS id o20si9015040icm.2.2015.05.19.12.47.14
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 19 May 2015 12:47:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of calabrese@google.com designates 2607:f8b0:4001:c03::22c as permitted sender) client-ip=2607:f8b0:4001:c03::22c;
Original-Received: by iepj10 with SMTP id j10so22504459iep.3
        for <std-proposals@isocpp.org>; Tue, 19 May 2015 12:47:14 -0700 (PDT)
X-Received: by 10.50.79.167 with SMTP id k7mr23537431igx.32.1432064834173;
 Tue, 19 May 2015 12:47:14 -0700 (PDT)
Original-Received: by 10.107.157.129 with HTTP; Tue, 19 May 2015 12:47:14 -0700 (PDT)
In-Reply-To: <e6f6357e-1206-4817-a439-4599b8da6f48@isocpp.org>
X-Original-Sender: calabrese@google.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of calabrese@google.com designates 2607:f8b0:4001:c03::22c as
 permitted sender) smtp.mail=calabrese@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: Matt Calabrese <calabrese@google.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:17998
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/17998>

--089e013a1a38bc998d0516749339
Content-Type: text/plain; charset=UTF-8

On Tue, May 19, 2015 at 12:40 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
>
> Well, the reason it's not noexcept is that `unique_function` is allowed to
> store non-moveable types. And since the type is erased (unlike, say,
> non-moveable std::vector), the only way to signal an error when you attempt
> to move it is to throw an exception.
>
> That being said, I don't think the benefits of being able to store
> immobile functions outweight the benefits of having noexcept move
> constructor/assignment.
>

Or just don't require invocation of the move constructor since you can,
instead, copy the pointer to it if it's in remote storage (and you just
force remote storage if the operation isn't noexcept, even if it fits in
the small object storage). I don't buy the "what if the move constructor
has side effects so we must call it" standpoint, since the language already
allows things like copy/move elision for return value and argument passing.
You can implement no-except move even if the type-erased object has a move
constructor that can throw.

FWIW, I'm pretty sure the proposed std::any has noexcept move operations.

-- 

--- 
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/.

--089e013a1a38bc998d0516749339
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, May 19, 2015 at 12:40 PM, Nicol Bolas <span dir=3D"ltr">&lt;<a href=3D"=
mailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>&gt;</=
span> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Well, the =
reason it&#39;s not noexcept is that `unique_function` is allowed to store =
non-moveable types. And since the type is erased (unlike, say, non-moveable=
 std::vector), the only way to signal an error when you attempt to move it =
is to throw an exception.<br><br>That being said, I don&#39;t think the ben=
efits of being able to store immobile functions outweight the benefits of h=
aving noexcept move constructor/assignment.</div></div></blockquote><div><b=
r></div><div>Or just don&#39;t require invocation of the move constructor s=
ince you can, instead, copy the pointer to it if it&#39;s in remote storage=
 (and you just force remote storage if the operation isn&#39;t noexcept, ev=
en if it fits in the small object storage). I don&#39;t buy the &quot;what =
if the move constructor has side effects so we must call it&quot; standpoin=
t, since the language already allows things like copy/move elision for retu=
rn value and argument passing. You can implement no-except move even if the=
 type-erased object has a move constructor that can throw.</div><div><br></=
div><div>FWIW, I&#39;m pretty sure the proposed std::any has noexcept move =
operations.</div></div></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 />

--089e013a1a38bc998d0516749339--

.
