220 29893 <CAM76qmtM9vxhmiCSaFLSm5Toct3qQ07wpPZU=bJa_v6H9BQbjQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Manuel Bergler <berglerma@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: New smart pointer: CopyConstructible and
 CopyAssignable flavor of unique_ptr
Date: Sat, 17 Dec 2016 22:25:36 +0100
Lines: 72
Approved: news@gmane.org
Message-ID: <CAM76qmtM9vxhmiCSaFLSm5Toct3qQ07wpPZU=bJa_v6H9BQbjQ@mail.gmail.com>
References: <3df7e8eb-01a0-7804-f476-504b5a25a9fe@gmail.com>
 <CAFk2RUaY3+MnXkmvaC=LxgRA_RD_XQpFfX-HT6X3iq1wD7ggCg@mail.gmail.com>
 <20161217170428.GA10214@manuel-ThinkPad-L440.localdomain> <20161217171633.4919375.58072.21574@gmail.com>
 <CAEddoJaAZkeJS9Maj2z0vYGnfuNnJZ+qFFdjeQyesTF5itJxHA@mail.gmail.com>
 <15884364-3238-41c7-bc5a-aa5595a64ade@isocpp.org> <20161217182130.GA4347@manuel-ThinkPad-L440.localdomain>
 <5eae5f16-e129-4c95-8001-fc73cc4f3d03@isocpp.org> <20161217192812.GA17421@manuel-ThinkPad-L440.localdomain>
 <cb822c5c-fc50-48e5-ad60-fdb14580329c@isocpp.org> <20161217210804.GA10967@manuel-ThinkPad-L440.localdomain>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a114488a6daee590543e153c8
X-Trace: blaine.gmane.org 1482009940 16149 195.159.176.226 (17 Dec 2016 21:25:40 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Dec 2016 21:25:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDOZBAUFX4MRBUO223BAKGQETKRP34I@isocpp.org Sat Dec 17 22:25:35 2016
Return-path: <std-proposals+bncBDOZBAUFX4MRBUO223BAKGQETKRP34I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f69.google.com ([74.125.83.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDOZBAUFX4MRBUO223BAKGQETKRP34I@isocpp.org>)
	id 1cIMU2-00035K-KX
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Dec 2016 22:25:34 +0100
Original-Received: by mail-pg0-f69.google.com with SMTP id f188sf286946009pgc.1
        for <gclcip-std-proposals@m.gmane.org>; Sat, 17 Dec 2016 13:25:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=dAcVGRIc1uQ7p0vDk5/cBfVMnJy2LmMigsoVID3TVFI=;
        b=ehIQhcjRJfgTTz3T8N0jKADvsNsC18zNCV70qoHOnckHZGIG/u8w/xcSMmv95/3e7Y
         jpUYPjy0XzQubmEhhmld8MSNLqAuEA6TNiSTooHzOsFzggmSS1aUCN6huQYhYthpoSvP
         7X0/C2Yggz1zPRvCvSK7qdXVbQp7IvXMJ+5QQZEl7wn2gUibE5TuiOw1mzmiGIS9PYRm
         SR5twzPhCrgInTV2TbjgpXaESQY6IepzIg5C8Bp9fSOZNxWQ54d8XHKTPVvKtmCbbldO
         +4jgC9SuEpxQAshlg4lDdHD6oR30fVNmBsoCZwiDjuEKKyOl9iOg7saeKUYNSKDIZ/X6
         Dm1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=dAcVGRIc1uQ7p0vDk5/cBfVMnJy2LmMigsoVID3TVFI=;
        b=C+XUJ1BD+ZWiN5Kr4Hfq1h96Q2YL3r9/yHyXEXZf+/O4Hy4PPAQnkSI03r4tWU32RI
         vQ+imVIFTsbbOa3qXbAmkM/VJJn06ziMJQZ/YkQ7gJqZxMfq0ZZ68zsHpXsd2EtraHA2
         YAjXus23npSdkVgRqtuDWnpbrvRA1dq/TB38F4PBYWiWKC81189U8U9Eqv/RuGh1bMn0
         xIxaeFCOe5UMr71eVhrSkEae1j8U2Gtt+Gar2+3QaQqQwFz0LdTkuAewv+lzmXg6Vavq
         JcpMhSOLUqcz/Cc+NPpdbdm5yHW38xzZvS3BeMelXcm/aO2rRZl0Y+QkB4xspIoPzgfk
         OTMQ==
X-Gm-Message-State: AKaTC01ekaah1MAhYwipkTlMYdJvaiuoGX6LfEuZaWswaVUbx8v3jRBuJ+4DusRSEo1Pkg==
X-Received: by 10.99.108.71 with SMTP id h68mr5294460pgc.23.1482009938743;
        Sat, 17 Dec 2016 13:25:38 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.11.41 with SMTP id v41ls3007227ioi.37.gmail; Sat, 17 Dec
 2016 13:25:37 -0800 (PST)
X-Received: by 10.36.71.208 with SMTP id t199mr3683829itb.112.1482009937483;
        Sat, 17 Dec 2016 13:25:37 -0800 (PST)
Original-Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com. [2607:f8b0:4001:c0b::22a])
        by mx.google.com with ESMTPS id n64si6505474itn.57.2016.12.17.13.25.37
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 17 Dec 2016 13:25:37 -0800 (PST)
Received-SPF: pass (google.com: domain of berglerma@gmail.com designates 2607:f8b0:4001:c0b::22a as permitted sender) client-ip=2607:f8b0:4001:c0b::22a;
Original-Received: by mail-it0-x22a.google.com with SMTP id b132so21000425iti.1
        for <std-proposals@isocpp.org>; Sat, 17 Dec 2016 13:25:37 -0800 (PST)
X-Received: by 10.36.76.81 with SMTP id a78mr9277080itb.30.1482009937109; Sat,
 17 Dec 2016 13:25:37 -0800 (PST)
Original-Received: by 10.79.13.203 with HTTP; Sat, 17 Dec 2016 13:25:36 -0800 (PST)
In-Reply-To: <20161217210804.GA10967@manuel-ThinkPad-L440.localdomain>
X-Original-Sender: berglerma@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 berglerma@gmail.com designates 2607:f8b0:4001:c0b::22a as permitted sender)
 smtp.mailfrom=berglerma@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:29893
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29893>

--001a114488a6daee590543e153c8
Content-Type: text/plain; charset=UTF-8

On Sat, Dec 17, 2016 at 10:08 PM, Manuel Bergler <berglerma@gmail.com>
wrote:

> Apparently clang and gcc interpret this differently: They move it into
> place due to the std::move (see http://coliru.stacked-crooked.
> com/a/cbe39ffef2ebf716).
>
> So in case of clang/gcc in my example the call to std::accumulate wouldn't
> invalidate existing references. But who knows, maybe some implementer of
> the standard library will interpret the requirements the same way you did
> and actually perform a copy. But only forgetting to `return
> std::move(acc);` in the lambda used for `std::accumulate` and using just
> `return acc;` results in a copy.
>

I just tested it with msvc (http://rextester.com/SZRHBC97716), as a matter
of fact they do indeed perform the copy as you suggested. So you end up
with platform dependent behavior for this one...

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAM76qmtM9vxhmiCSaFLSm5Toct3qQ07wpPZU%3DbJa_v6H9BQbjQ%40mail.gmail.com.

--001a114488a6daee590543e153c8
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 S=
at, Dec 17, 2016 at 10:08 PM, Manuel Bergler <span dir=3D"ltr">&lt;<a href=
=3D"mailto:berglerma@gmail.com" target=3D"_blank">berglerma@gmail.com</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
class=3D"gmail-HOEnZb"><div class=3D"gmail-h5"></div></div>
Apparently clang and gcc interpret this differently: They move it into plac=
e due to the std::move (see <a href=3D"http://coliru.stacked-crooked.com/a/=
cbe39ffef2ebf716" rel=3D"noreferrer" target=3D"_blank">http://coliru.stacke=
d-crooked.<wbr>com/a/cbe39ffef2ebf716</a>).<br>
<br>
So in case of clang/gcc in my example the call to std::accumulate wouldn&#3=
9;t invalidate existing references. But who knows, maybe some implementer o=
f the standard library will interpret the requirements the same way you did=
 and actually perform a copy. But only forgetting to `return std::move(acc)=
;` in the lambda used for `std::accumulate` and using just `return acc;` re=
sults in a copy.<br></blockquote><div><br></div><div>I just tested it with =
msvc (<a href=3D"http://rextester.com/SZRHBC97716">http://rextester.com/SZR=
HBC97716</a>), as a matter of fact they do indeed perform the copy as you s=
uggested. So you end up with platform dependent behavior for this one...<br=
></div></div></div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAM76qmtM9vxhmiCSaFLSm5Toct3qQ07wpPZU=
%3DbJa_v6H9BQbjQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAM76qmtM9vxhmi=
CSaFLSm5Toct3qQ07wpPZU%3DbJa_v6H9BQbjQ%40mail.gmail.com</a>.<br />

--001a114488a6daee590543e153c8--

.
