220 5220 <CAFk2RUbJ1AqZ==1zsCQjtVm-YRuLhRjtXzyV=kPvX1FH8q9z6g@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: Tue, 25 Jun 2013 21:14:37 +0300
Lines: 72
Approved: news@gmane.org
Message-ID: <CAFk2RUbJ1AqZ==1zsCQjtVm-YRuLhRjtXzyV=kPvX1FH8q9z6g@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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=20cf306844d580a1e604dffe807d
X-Trace: ger.gmane.org 1372184078 25893 80.91.229.3 (25 Jun 2013 18:14:38 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 25 Jun 2013 18:14:38 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBDN4U6HAKGQEHSAEOPI@isocpp.org Tue Jun 25 20:14:39 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBDN4U6HAKGQEHSAEOPI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vb0-f70.google.com ([209.85.212.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBDN4U6HAKGQEHSAEOPI@isocpp.org>)
	id 1UrXlH-0008T5-69
	for gclcip-std-proposals@m.gmane.org; Tue, 25 Jun 2013 20:14:39 +0200
Original-Received: by mail-vb0-f70.google.com with SMTP id q12sf17072514vbe.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 25 Jun 2013 11:14:38 -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=t9qNsvtUitrq0U3Woc7b2Bzn4EIrcSp/vW486W3Qzfk=;
        b=kpsk4Q9HVcUi262Pai3yfDez4F8UR58LIBjHOtBRlBLewLVeBTlFcYqJfLUSazJaaG
         UPqFSNm2mVHUL9wP3Riek9l7tGmcvHXiqsXzBCbbcl4LXJjQcTCXQMGBUMLvO4cvise5
         lJPTcDr3QJpj2xesl27gpmxOOgriy9pKspvgoh9FJk4B6Ss5X4XlxAW1dIn8zeuiuUXn
         dNb7uXyXgip5HQ7zSqQhjMvCFW0FAspIlybf9gSwRC+V8vFAE7CGJ+f90XtuWBdMjvCq
         SzJEa10oCVPhu3jrhUGcc9OmAPrVdDFDDhsZvzxNcqGrPTdqsnJBJSpKUN+v0Kqsicks
         mFxg==
X-Received: by 10.236.20.83 with SMTP id o59mr97979yho.28.1372184078347;
        Tue, 25 Jun 2013 11:14:38 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.94.212 with SMTP id de20ls112212qeb.44.gmail; Tue, 25 Jun
 2013 11:14:37 -0700 (PDT)
X-Received: by 10.229.164.19 with SMTP id c19mr98751qcy.3.1372184077571;
        Tue, 25 Jun 2013 11:14:37 -0700 (PDT)
Original-Received: from mail-qe0-x232.google.com (mail-qe0-x232.google.com [2607:f8b0:400d:c02::232])
        by mx.google.com with ESMTPS id dt7si11017803qeb.80.2013.06.25.11.14.37
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 25 Jun 2013 11:14:37 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c02::232 as permitted sender) client-ip=2607:f8b0:400d:c02::232;
Original-Received: by mail-qe0-f50.google.com with SMTP id f6so679432qej.9
        for <std-proposals@isocpp.org>; Tue, 25 Jun 2013 11:14:37 -0700 (PDT)
X-Received: by 10.224.105.199 with SMTP id u7mr1227386qao.33.1372184077439;
 Tue, 25 Jun 2013 11:14:37 -0700 (PDT)
Original-Received: by 10.224.174.143 with HTTP; Tue, 25 Jun 2013 11:14:37 -0700 (PDT)
In-Reply-To: <73cad38f-c1b6-4ce3-bfc1-e4a660dbb638@isocpp.org>
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:c02::232 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:5220
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5220>

--20cf306844d580a1e604dffe807d
Content-Type: text/plain; charset=ISO-8859-1

On 25 June 2013 21:01, Mikhail Semenov <mikhailsemenov1957@gmail.com> wrote:

> You don't actually need the static_cast here. The following will do:
>
> *std::unique_ptr<const Foo> FooFactory() {*
>
>> *  std::unique_ptr<const Foo> result(new Foo);*
>> *  // ...*
>> *  return result;*
>> *}*
>>
>>
>>
>>
Except that it won't for cases where the factory wants to modify the Foo
stored inside the unique_ptr
before ultimately returning it as a unique_ptr to const Foo.

-- 

--- 
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/.



--20cf306844d580a1e604dffe807d
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 25 June 2013 21:01, 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>You don&#39;t actually need the static_=
cast here. The following will do:</div><div class=3D"im"><div><br><b>std::u=
nique_ptr&lt;const Foo&gt; FooFactory() {</b></div>
</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;p=
adding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bo=
rder-left-style:solid"><div><div><b>=A0 std::unique_ptr&lt;const Foo&gt; re=
sult(new Foo);</b></div>
<div><b>=A0 // ...</b></div><div><b>=A0 return result;</b></div><div><b>}</=
b></div></div><div>=A0</div><div><br><br></div></blockquote></blockquote><d=
iv><br></div><div>Except that it won&#39;t for cases where the factory want=
s to modify the Foo stored inside the unique_ptr<br>
</div><div>before ultimately returning it as a unique_ptr to const Foo. <br=
></div></div><br></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 />

--20cf306844d580a1e604dffe807d--

.
