220 5231 <CAFk2RUZki=oMa33NHpO5=Yn6aNuu61PJqQAAc2KPjPUZ95tF5A@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Teachability problems with std::move
Date: Wed, 26 Jun 2013 14:23:41 +0300
Lines: 80
Approved: news@gmane.org
Message-ID: <CAFk2RUZki=oMa33NHpO5=Yn6aNuu61PJqQAAc2KPjPUZ95tF5A@mail.gmail.com>
References: <CA+cyFgsYFbjG1M98PJS-XVzuJYbQmt7=4GOqS5_V5-WVJ0caLg@mail.gmail.com>
	<aa993593-2e71-4c1e-a510-d678672e5c17@isocpp.org>
	<73cad38f-c1b6-4ce3-bfc1-e4a660dbb638@isocpp.org>
	<CAFk2RUbJ1AqZ==1zsCQjtVm-YRuLhRjtXzyV=kPvX1FH8q9z6g@mail.gmail.com>
	<09ec0612-ac10-48fb-a186-bd3c200bd5fe@isocpp.org>
	<20f56505-2fba-4041-9d81-26088e67dc5d@isocpp.org>
	<CAMeU-s1SWuGH0J-o=ojWEV5w3JTO6J=OgDe92mf9w8dV7+emtw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1132eceec2610e04e00ce00a
X-Trace: ger.gmane.org 1372245823 26257 80.91.229.3 (26 Jun 2013 11:23:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 26 Jun 2013 11:23:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBPU6VOHAKGQENUI7A2A@isocpp.org Wed Jun 26 13:23:45 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBPU6VOHAKGQENUI7A2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f69.google.com ([209.85.213.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBPU6VOHAKGQENUI7A2A@isocpp.org>)
	id 1Urnp9-0003ec-T4
	for gclcip-std-proposals@m.gmane.org; Wed, 26 Jun 2013 13:23:44 +0200
Original-Received: by mail-yh0-f69.google.com with SMTP id b12sf19506493yha.8
        for <gclcip-std-proposals@m.gmane.org>; Wed, 26 Jun 2013 04:23:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere: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:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=xz2iM3xt1RApKP6onRlMrWqOpomo1CVI/MtNsU6/SJk=;
        b=XcdY6YHP0WtOG5GQATFqZ4d8LVNsioXw92iBPC9WzsOFz9jbEEIex8hu9CKIIOJdOl
         utPoueG/yeOhWIW07j6qKUnIAjovL5KWO3OumTAkZfGgzi6HS4DaxuT1oyaR4KeG2SLY
         yw5WJYvNf2/+sqDXrmmfIBQL+2mROVYXegK8SpwCibgiGaJsyUuQ8ITiht6T09/BGkXj
         pe9zQU1YXSPiol/AS2rjBbIFz8vCLlMSSLpSiC7BS91FlC9PPP3ddMU4e2dxd1cEbqIN
         430+GePQKKnrVBMm9yfwKRbUrzkOGBVgkUmPbkhkcOBO7nVmcg1NkbwvXELmvv5Vebs2
         qNiQ==
X-Received: by 10.236.79.67 with SMTP id h43mr1864851yhe.46.1372245822967;
        Wed, 26 Jun 2013 04:23:42 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.107.129 with SMTP id hc1ls352969qeb.78.gmail; Wed, 26 Jun
 2013 04:23:42 -0700 (PDT)
X-Received: by 10.224.26.7 with SMTP id b7mr4629373qac.102.1372245822095;
        Wed, 26 Jun 2013 04:23:42 -0700 (PDT)
Original-Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com [2607:f8b0:400d:c01::230])
        by mx.google.com with ESMTPS id t4si6057762qap.134.2013.06.26.04.23.42
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 26 Jun 2013 04:23:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::230 as permitted sender) client-ip=2607:f8b0:400d:c01::230;
Original-Received: by mail-qc0-f176.google.com with SMTP id z10so8104488qcx.35
        for <std-proposals@isocpp.org>; Wed, 26 Jun 2013 04:23:42 -0700 (PDT)
X-Received: by 10.229.174.70 with SMTP id s6mr899702qcz.104.1372245821905;
 Wed, 26 Jun 2013 04:23:41 -0700 (PDT)
Original-Received: by 10.224.174.143 with HTTP; Wed, 26 Jun 2013 04:23:41 -0700 (PDT)
In-Reply-To: <CAMeU-s1SWuGH0J-o=ojWEV5w3JTO6J=OgDe92mf9w8dV7+emtw@mail.gmail.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::230 as
 permitted sender) smtp.mail=ville.voutilainen@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:5231
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5231>

--001a1132eceec2610e04e00ce00a
Content-Type: text/plain; charset=ISO-8859-1

On 26 June 2013 14:10, Mikhail Semenov <mikhailsemenov1957@gmail.com> wrote:

> > Coming back to the original topic, are you really suggesting the code
> above is the ideal form for teaching when to use std::move and when > not
> to?  I think "return result;" is much simpler.
>
> If you have to convert from std::unique_ptr<Foo> to std::unique_ptr<const
> Foo>
> the following code *WON'T COMPILE*;
> *return result;*
>
> *Try it in your compiler!*
>

We know. There's no need to shout. The whole question is whether it should
be valid, aka compile.
The conversion in this case is perfectly safe, so perhaps we should
consider relaxing the rules.

-- 

--- 
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/.



--001a1132eceec2610e04e00ce00a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 26 June 2013 14:10, Mikhail Semenov <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemenov1=
957@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im"><div><font style color=3D"=
#3333ff">&gt; Coming back to the original topic, are you really suggesting =
the code above is the ideal form for teaching when to use std::move and whe=
n &gt; not to?=A0 I think &quot;return result;&quot; is much simpler.<br>

</font></div>
<div><font style color=3D"#3333ff"><font color=3D"#000000"></font></font>=
=A0</div>
</div><div><font style color=3D"#3333ff"><font color=3D"#000000">If you hav=
e to convert from std::unique_ptr&lt;Foo&gt; to std::unique_ptr&lt;const Fo=
o&gt;</font></font></div>
<div>the following code <font color=3D"#ff0000"><b>WON&#39;T COMPILE</b></f=
ont>;</div>
<div><b>return result;</b></div>
<div>=A0</div>
<div><font color=3D"#ff6666"><b>Try it in your compiler!</b></font></div></=
blockquote><div><br></div><div>We know. There&#39;s no need to shout. The w=
hole question is whether it should be valid, aka compile.<br></div><div>
The conversion in this case is perfectly safe, so perhaps we should conside=
r relaxing the rules.<br></div></div></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
&nbsp;<br />
&nbsp;<br />

--001a1132eceec2610e04e00ce00a--

.
