220 18001 <CAGg_6+OTYuqGVqkNWPEsHfP2b7aZmL=y+NjSR1sHtno1XUm24Q@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Nevin Liber <nevin@eviloverlord.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: First draft: Non-copyable call wrapper, std::unique_function
Date: Tue, 19 May 2015 15:06:16 -0500
Lines: 94
Approved: news@gmane.org
Message-ID: <CAGg_6+OTYuqGVqkNWPEsHfP2b7aZmL=y+NjSR1sHtno1XUm24Q@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> <CANh8DEmVOed-AybOpyLy-C6i4mc1wxUbTjCys6sTkGL48L=Qig@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7bb70e4a4e98ab051674da52
X-Trace: ger.gmane.org 1432066021 21777 80.91.229.3 (19 May 2015 20:07:01 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 19 May 2015 20:07:01 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCE35H5S6IDBBYVP52VAKGQE2UV2QMI@isocpp.org Tue May 19 22:07:00 2015
Return-path: <std-proposals+bncBCE35H5S6IDBBYVP52VAKGQE2UV2QMI@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+bncBCE35H5S6IDBBYVP52VAKGQE2UV2QMI@isocpp.org>)
	id 1Yunn2-0001V1-A5
	for gclcip-std-proposals@m.gmane.org; Tue, 19 May 2015 22:07:00 +0200
Original-Received: by lagv1 with SMTP id v1sf9747572lag.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 19 May 2015 13:07:00 -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:sender:in-reply-to:references:from
         :date:message-id:subject: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=DjYjM8DW4QoD/GesPtThBLUk/Eqs9PKwyPeepnO37sA=;
        b=LQPyD/Ulg6Tf+HZQw3AxaefzYluwTEt/7J+sKyPJKYbEMmAZmv7N89NKXIEc0c9tL4
         qv7wI19y6EK4af37BAuIg0bOav/5XVUPMm7HX7zlaShMcLsjJtmzR3VLWD3eN5KBg6Wg
         pSFgnlUWpQO04KVdTQHj3nUknXM+vTLtcDYfUNHJawhqoVNcHCwQq6KQ4CuVUSwRitSw
         he0/X7k59LvsgmFidEdwNeI+A/5DE0Ci6u9ACCuMiH+YJfFhBg7NgCEuVPIPFncpjqrQ
         wnycKiuYh3MEMXMbtdP2eInAmj29mNDZdRQV1Fi7DOHXwOqkfAVZMM9WFbRQrUIH9vj+
         +7CA==
X-Gm-Message-State: ALoCoQl1V4CBbdqsIT5i0F05qOASfEtnlJAYz/s8XT8Ja7t1cF/dSyFd3An6P6zhZMpvKVcpYNYb
X-Received: by 10.180.106.10 with SMTP id gq10mr15395728wib.0.1432066019954;
        Tue, 19 May 2015 13:06:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.163.65 with SMTP id yg1ls100673lab.26.gmail; Tue, 19 May
 2015 13:06:58 -0700 (PDT)
X-Received: by 10.112.40.9 with SMTP id t9mr23623728lbk.55.1432066018264;
        Tue, 19 May 2015 13:06:58 -0700 (PDT)
Original-Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e])
        by mx.google.com with ESMTPS id sw10si9737282lbb.158.2015.05.19.13.06.58
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 19 May 2015 13:06:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of nliber@gmail.com designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e;
Original-Received: by laat2 with SMTP id t2so41778638laa.1
        for <std-proposals@isocpp.org>; Tue, 19 May 2015 13:06:58 -0700 (PDT)
X-Received: by 10.112.119.163 with SMTP id kv3mr23354943lbb.101.1432066018152;
 Tue, 19 May 2015 13:06:58 -0700 (PDT)
Original-Sender: nliber@gmail.com
Original-Received: by 10.114.79.6 with HTTP; Tue, 19 May 2015 13:06:16 -0700 (PDT)
In-Reply-To: <CANh8DEmVOed-AybOpyLy-C6i4mc1wxUbTjCys6sTkGL48L=Qig@mail.gmail.com>
X-Original-Sender: nevin@eviloverlord.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of nliber@gmail.com designates 2a00:1450:4010:c03::22e as permitted
 sender) smtp.mail=nliber@gmail.com;       dkim=pass header.i=@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:18001
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18001>

--047d7bb70e4a4e98ab051674da52
Content-Type: text/plain; charset=UTF-8

On 19 May 2015 at 14:47, 'Matt Calabrese' via ISO C++ Standard - Future
Proposals <std-proposals@isocpp.org> wrote:

> 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.
>

Worse, if you required it, you'd have to do a second heap allocation for
moves that couldn't be embedded in the unique_function object just to call
it.  Ugh.
-- 
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

-- 

--- 
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/.

--047d7bb70e4a4e98ab051674da52
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 1=
9 May 2015 at 14:47, &#39;Matt Calabrese&#39; via ISO C++ Standard - Future=
 Proposals <span dir=3D"ltr">&lt;<a href=3D"mailto:std-proposals@isocpp.org=
" target=3D"_blank">std-proposals@isocpp.org</a>&gt;</span> wrote:<br><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><div =
class=3D"gmail_quote"><span class=3D"">On Tue, May 19, 2015 at 12:40 PM, Ni=
col Bolas <span dir=3D"ltr">&lt;<a href=3D"mailto:jmckesson@gmail.com" targ=
et=3D"_blank">jmckesson@gmail.com</a>&gt;</span> wrote:<blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-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 th=
e type is erased (unlike, say, non-moveable std::vector), the only way to s=
ignal an error when you attempt to move it is to throw an exception.<br><br=
>That being said, I don&#39;t think the benefits of being able to store imm=
obile functions outweight the benefits of having noexcept move constructor/=
assignment.</div></div></blockquote><div><br></div></span><div>Or just don&=
#39;t require invocation of the move constructor since you can, instead, co=
py the pointer to it if it&#39;s in remote storage (and you just force remo=
te storage if the operation isn&#39;t noexcept, even if it fits in the smal=
l object storage). I don&#39;t buy the &quot;what if the move constructor h=
as side effects so we must call it&quot; standpoint, since the language alr=
eady allows things like copy/move elision for return value and argument pas=
sing.</div></div></div></div></blockquote><div><br></div><div>Worse, if you=
 required it, you&#39;d have to do a second heap allocation for moves that =
couldn&#39;t be embedded in the unique_function object just to call it.=C2=
=A0 Ugh.</div></div>-- <br><div class=3D"gmail_signature">=C2=A0Nevin &quot=
;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"mailto:nevin@eviloverlord.com"=
 target=3D"_blank">nevin@eviloverlord.com</a>&gt;=C2=A0 (847) 691-1404</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 />

--047d7bb70e4a4e98ab051674da52--

.
