220 5222 <09ec0612-ac10-48fb-a186-bd3c200bd5fe@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Teachability problems with std::move
Date: Tue, 25 Jun 2013 11:46:25 -0700 (PDT)
Lines: 59
Approved: news@gmane.org
Message-ID: <09ec0612-ac10-48fb-a186-bd3c200bd5fe@isocpp.org>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_754_602566.1372185985239"
X-Trace: ger.gmane.org 1372185985 14731 80.91.229.3 (25 Jun 2013 18:46:25 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 25 Jun 2013 18:46:25 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDC55PNFRYGRBAOLU6HAKGQE7TERKHY@isocpp.org Tue Jun 25 20:46:27 2013
Return-path: <std-proposals+bncBDC55PNFRYGRBAOLU6HAKGQE7TERKHY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f198.google.com ([209.85.128.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDC55PNFRYGRBAOLU6HAKGQE7TERKHY@isocpp.org>)
	id 1UrYG2-00016s-T2
	for gclcip-std-proposals@m.gmane.org; Tue, 25 Jun 2013 20:46:27 +0200
Original-Received: by mail-ve0-f198.google.com with SMTP id jz10sf18267572veb.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 25 Jun 2013 11:46:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=HqdXWrEZhoFCrXfFmNHCToyLJu0yFO2wUw74Fg1Ay6I=;
        b=aS4xQotK0kPV7xDncr8oCtHU6mYPWZllc+W/SlTpUoYevsb1s2ZgyehDqI8FpWSYGH
         n5I0pU7+RlATRZ7rS7ujMrAb4AennoaGSq4b1tfKHqB5Y5aq+z/i4UFLcn7x5xf1//DZ
         wQwkXtBV9+A4KxakCP3uTCmP1eRzN03i93R5uLWXkU1x3jvR56Vwkg3ABTXoYMugQZQv
         0r/Uh4gXGGk2b2vgHvxGF7DnP0tUjdr2+MzWfRlYQu5CuwD2SuQAjlPDxjqBqvuQeJhr
         9v4EtaXog7G3MQmbfSs8X4VGrOyRv5Z9NmsmVwGv247wYPwu3xd2wUQmR7nCCmtTg6am
         imbg==
X-Received: by 10.236.42.116 with SMTP id i80mr181922yhb.26.1372185986063;
        Tue, 25 Jun 2013 11:46:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.14.131 with SMTP id p3ls134599qec.93.gmail; Tue, 25 Jun
 2013 11:46:25 -0700 (PDT)
X-Received: by 10.49.13.71 with SMTP id f7mr9903qec.31.1372185985524;
        Tue, 25 Jun 2013 11:46:25 -0700 (PDT)
In-Reply-To: <CAFk2RUbJ1AqZ==1zsCQjtVm-YRuLhRjtXzyV=kPvX1FH8q9z6g@mail.gmail.com>
X-Original-Sender: mikhailsemenov1957@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:5222
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5222>

------=_Part_754_602566.1372185985239
Content-Type: text/plain; charset=ISO-8859-1

If you really need to convert, I suggest make it explicit:
 
*std::unique_ptr<const Foo> FooFactory() {*
*  std::unique_ptr<Foo> result(new Foo);*
*  // ...*
*  return std::unique_ptr<const Foo>(std::move(result));*
*}*
** 
It would be clear what you are doing.
 
By the way, where I work we always write explicit casts.

 

-- 

--- 
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/.



------=_Part_754_602566.1372185985239
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div><div>If you really need to convert, I suggest make it explicit:</div><=
div>&nbsp;</div><div><strong>std::unique_ptr&lt;const Foo&gt; FooFactory() =
{</strong></div><div><strong>&nbsp; std::unique_ptr&lt;Foo&gt; result(new F=
oo);</strong></div><div><strong>&nbsp; // ...</strong></div><div><strong>&n=
bsp; return std::unique_ptr&lt;const Foo&gt;(std::move(result));</strong></=
div><div><strong>}</strong></div></div><div><strong></strong>&nbsp;</div><d=
iv>It would be clear what you are doing.</div><div>&nbsp;</div><div>By the =
way, where I work we always write explicit casts.</div><div><br>&nbsp;</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 />

------=_Part_754_602566.1372185985239--

.
