220 11830 <CAFk2RUa62obRokq3J5oato=Y5ahJLRjXhuifwkOEs1uw89pEyg@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: N4078: Rvalue reference overloads for value()
 method returns object by value
Date: Fri, 11 Jul 2014 10:35:18 +0300
Lines: 33
Approved: news@gmane.org
Message-ID: <CAFk2RUa62obRokq3J5oato=Y5ahJLRjXhuifwkOEs1uw89pEyg@mail.gmail.com>
References: <b538efba-faf4-4ffc-a553-302b9d2ba2c0@isocpp.org>
	<CANh-dX=M7niArNp-1sCcqxaREEJSxmjMftgw7uMHN9YnZC-h+w@mail.gmail.com>
	<4DA018C3-2327-4F55-B7F8-7988EC7B789A@gmail.com>
	<1a858a77-310b-4591-aaf5-960c40d9f5fc@isocpp.org>
	<66AF41C1-CB37-4311-98EA-D47DBC6068DC@gmail.com>
	<66c38b61-7a95-4ace-b34f-2346bb334fb9@isocpp.org>
	<F1CBA358-0AD8-4ADD-99DA-6D00FCFE150F@gmail.com>
	<CAFk2RUZENmaMW5NwBaiF6byfhgRyPUsSmuyVjnRDhbjcfaTtQA@mail.gmail.com>
	<CC03CC1C-8487-40C8-97DF-2CA7661DAD55@gmail.com>
	<CAFk2RUa7-WTcL=XFYO8KMyU4rdpjDEfFM6n6SkUZ=SW_U7s5XQ@mail.gmail.com>
	<EF930317-EB97-402E-A3A0-CC46E7E2D998@gmail.com>
	<CAFk2RUZigiwLwFpfVXuFS8cqy38hPG3OGhGUi+iNwSYuYvyAyQ@mail.gmail.com>
	<A46ADDB4-C9B0-4163-81BE-900CD879D8C8@gmail.com>
	<CAFk2RUZ-DqEcMeehjH8KedYgErxKMq4O9kmeN4FZzjkXMYSsiw@mail.gmail.com>
	<6F4B3C72-9962-48DC-8527-0C89EA1B9710@gmail.com>
	<CAFk2RUb5xynaoQx-j4cQuXC8t-0GGc9-CZyRA2V=j6cfuNQV=g@mail.gmail.com>
	<35873CE5-ED8C-4C03-A6A1-E4132DECD91F@gmail.com>
	<CAFk2RUYRJSNcXykj9oPd=3EehSozf7PcX8ACM_hrqhK+Ur2V8A@mail.gmail.com>
	<335948E6-8140-4673-B958-930356A52070@gmail.com>
	<CAFk2RUYf+tpBvxiK00O=FncB01BWe6+SXiYBN7fixd4mhm+Z-w@mail.gmail.com>
	<76ACA175-5A44-4BE8-B49F-BAC6DA65E6B1@gmail.com>
	<CAFk2RUah5k9zy_mQqeNN9mec0PYkmKDZp7LVXm64dTeSLaw6nQ@mail.gmail.com>
	<4D3852AD-1AEB-44BA-941C-D645BAD19405@gmail.com>
	<b56d94d4-8937-41f1-8484-753279fcd725@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1405064127 17813 80.91.229.3 (11 Jul 2014 07:35:27 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 11 Jul 2014 07:35:27 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBN5H72OQKGQEXIF6Y3I@isocpp.org Fri Jul 11 09:35:21 2014
Return-path: <std-proposals+bncBC5JHI7A7ALRBN5H72OQKGQEXIF6Y3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBN5H72OQKGQEXIF6Y3I@isocpp.org>)
	id 1X5VMW-0005Ix-Iq
	for gclcip-std-proposals@m.gmane.org; Fri, 11 Jul 2014 09:35:20 +0200
Original-Received: by mail-ie0-f199.google.com with SMTP id tr6sf3656137ieb.10
        for <gclcip-std-proposals@m.gmane.org>; Fri, 11 Jul 2014 00:35:19 -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:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=IHJegJ+GI9KhrgMr1qmyytz5k0Tkoz/xcZbVQYj5gzA=;
        b=W4QFLM3LwSeZG1zIm+fn6V6PgWfpxYxHoNKyiykNG/QG0qPuPPrJfwJ1icAx1LIsgh
         DFh9yUv+X+qkXJ2F4pB43mLsuLJPF4P5TMm4uPCVNQ30IrSTdznaK/RQLPVYw0S41WTw
         h5xjuSeQGqKv+FjuSoZLHiZjbh01GhM3Bj1ldIG7OyDW0h1XxVN68QAN9igoMUTeZ9n8
         dTTfkONqOhRG+Nm2mg5EbWgTBNiisx39c5MRR9rSrEt2cQynoWbJyquZVW3nYM2FGzOE
         ZDYIeoTCNTZmu/3HO/GwTwufO8ixXRfdXVeHWewopnSWpI4EBuFUI4zEW2lW7Gfv9CxE
         Rtmw==
X-Gm-Message-State: ALoCoQlxy5Nj2Kt6JJK77Gbo+jsRoEgsvzkC6QCrREY9FWisEu07iuJBOXRniaN8R1ZrNXJff+u2
X-Received: by 10.182.181.35 with SMTP id dt3mr7175077obc.9.1405064119668;
        Fri, 11 Jul 2014 00:35:19 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.25.144 with SMTP id 16ls232800qgt.45.gmail; Fri, 11 Jul
 2014 00:35:18 -0700 (PDT)
X-Received: by 10.140.21.170 with SMTP id 39mr57103312qgl.31.1405064118939;
        Fri, 11 Jul 2014 00:35:18 -0700 (PDT)
Original-Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [2607:f8b0:400d:c04::22b])
        by mx.google.com with ESMTPS id t2si169355qcq.34.2014.07.11.00.35.18
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 11 Jul 2014 00:35:18 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c04::22b as permitted sender) client-ip=2607:f8b0:400d:c04::22b;
Original-Received: by mail-qg0-f43.google.com with SMTP id a108so517493qge.16
        for <std-proposals@isocpp.org>; Fri, 11 Jul 2014 00:35:18 -0700 (PDT)
X-Received: by 10.140.109.118 with SMTP id k109mr83338384qgf.98.1405064118811;
 Fri, 11 Jul 2014 00:35:18 -0700 (PDT)
Original-Received: by 10.224.31.137 with HTTP; Fri, 11 Jul 2014 00:35:18 -0700 (PDT)
In-Reply-To: <b56d94d4-8937-41f1-8484-753279fcd725@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:c04::22b as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@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: <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:11830
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11830>

On 11 July 2014 08:28,  <tomaszkam@gmail.com> wrote:
>  I we add the following r-value overload as originally proposed, it will
> have following effect: //as always: optional<T> f();
>   1. *std::forward<U>(u) with optional will actually perfectly forward
>   2. auto&& v = f().value() - will still create a dangling refence (as it it
> will now we two dangling reference), auto will be deduced to T instead of
> T&, but v still we be l-value
>   3. g(f.value()), when g(const T&) accepts by cont& will work the same
>   4. h(f.value()), when h(T) accepts by value, will benefit from move
>   5. f().value() = 20, will no longer compile if T has l-value qualified
> operator=(T const&) & //this actullay should be a true
> I found this actually being good not-breaking changes, similar to one
> created my adding move constructor to every feasible class in C++11.
> And even adding it to the single optional will not create any surprising
> effect in the code
> I think adding such overloads to containers is actually possible, without
> breaking many code.


I think we should do what N3982 does with the addition of
const-rvalue-ref-qualified
 overloads. With the addition of those, people who care about
forwarding const-rvalues
perfectly will get what they need.

-- 

--- 
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/.

.
