220 11756 <CAFk2RUayWNC3sLTT_6uNJKzZxx9-xpPQrAhrq83xvQdjq4_amQ@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: Wed, 9 Jul 2014 23:11:10 +0300
Lines: 23
Approved: news@gmane.org
Message-ID: <CAFk2RUayWNC3sLTT_6uNJKzZxx9-xpPQrAhrq83xvQdjq4_amQ@mail.gmail.com>
References: <b538efba-faf4-4ffc-a553-302b9d2ba2c0@isocpp.org>
	<CANh-dX=M7niArNp-1sCcqxaREEJSxmjMftgw7uMHN9YnZC-h+w@mail.gmail.com>
	<2555993.7LIlHKVULI@tjmaciei-mobl4>
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 1404936682 28829 80.91.229.3 (9 Jul 2014 20:11:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 9 Jul 2014 20:11:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBX6D62OQKGQEULP3EQQ@isocpp.org Wed Jul 09 22:11:16 2014
Return-path: <std-proposals+bncBC5JHI7A7ALRBX6D62OQKGQEULP3EQQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yk0-f198.google.com ([209.85.160.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBX6D62OQKGQEULP3EQQ@isocpp.org>)
	id 1X4yCu-0003C5-O9
	for gclcip-std-proposals@m.gmane.org; Wed, 09 Jul 2014 22:11:12 +0200
Original-Received: by mail-yk0-f198.google.com with SMTP id 9sf18326328ykp.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Jul 2014 13:11:11 -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=6DvbJJ57wiVzyHJRxMNWzPt++8Fwsy7s6E8UoVB0P9w=;
        b=ehVh0zZHqMwQ0A7XkYK21N+S//EQRO8QPLvZgbL+AooU3a+MYe2S7ujYQKIv7RF4gh
         7NYVUQ7dgwD9U+FfBXROUoiEasbkBtusbUibtw0PFDQXqSKvR5/qRpn/rJmMDL6dSh5a
         zPuPNn82ltvC1FfNv8HzFv/GiVSfi2LCpjkKgZ5n3Ic12cKx4lLhC7z2GlYHQwjph89N
         doO19wCmqpMV6iX6JOaB+7H4huklm1KEkKqHBbSkB6IKKjOU6J+iTTQjILkUmVhIWV0m
         BL31dYZxt/NO+WBmAHgHx6lyzkyWs/IN3GQ5Yq45W8aTMy14FRzH6RCkLtf1Tq0Tjl/3
         uapQ==
X-Gm-Message-State: ALoCoQnMaQ+6PmM38qw8dnyY1d1t3cBl8vGDLFE6mmiCaoUosxgoA0LNfhX83kPsDVufhVfAM2Y+
X-Received: by 10.224.171.130 with SMTP id h2mr20810289qaz.7.1404936671765;
        Wed, 09 Jul 2014 13:11:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.98.225 with SMTP id o88ls4577qge.88.gmail; Wed, 09 Jul
 2014 13:11:11 -0700 (PDT)
X-Received: by 10.58.56.102 with SMTP id z6mr40424987vep.7.1404936671097;
        Wed, 09 Jul 2014 13:11:11 -0700 (PDT)
Original-Received: from mail-vc0-x22e.google.com (mail-vc0-x22e.google.com [2607:f8b0:400c:c03::22e])
        by mx.google.com with ESMTPS id 16si21991273vdd.92.2014.07.09.13.11.11
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 09 Jul 2014 13:11:11 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400c:c03::22e as permitted sender) client-ip=2607:f8b0:400c:c03::22e;
Original-Received: by mail-vc0-f174.google.com with SMTP id hy4so8214980vcb.5
        for <std-proposals@isocpp.org>; Wed, 09 Jul 2014 13:11:11 -0700 (PDT)
X-Received: by 10.220.44.20 with SMTP id y20mr2231202vce.60.1404936671029;
 Wed, 09 Jul 2014 13:11:11 -0700 (PDT)
Original-Received: by 10.224.31.137 with HTTP; Wed, 9 Jul 2014 13:11:10 -0700 (PDT)
In-Reply-To: <2555993.7LIlHKVULI@tjmaciei-mobl4>
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:400c:c03::22e 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: <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:11756
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11756>

On 9 July 2014 23:03, Thiago Macieira <thiago@macieira.org> wrote:
> On Wednesday 09 July 2014 12:09:14 'Jeffrey Yasskin' via ISO C++ Standard -
> Future Proposals wrote:
>>   std::pair<std::string, exception_ptr> g();
>>   auto&& s = g().first; //will create a dangling reference
>
> If you were to use auto or decltype(auto), the problem would go away, wouldn't
> it?


Some problems would, but some problems wouldn't. You may have an lvalue
optional and you don't want to get a copy of the underlying value in that case.
decltype(auto) will not help if the function returns an rvalue reference, since
that would be the type of decltype(auto), too, right?

-- 

--- 
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/.

.
