220 11800 <072cf8b4-4c74-438e-9999-0aab13bf3182@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: tomaszkam@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: N4078: Rvalue reference overloads for value()
 method returns object by value
Date: Thu, 10 Jul 2014 02:29:17 -0700 (PDT)
Lines: 84
Approved: news@gmane.org
Message-ID: <072cf8b4-4c74-438e-9999-0aab13bf3182@isocpp.org>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_82_21799650.1404984557394"
X-Trace: ger.gmane.org 1404984571 28031 80.91.229.3 (10 Jul 2014 09:29:31 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 10 Jul 2014 09:29:31 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDNPVXXG6IGBB3VZ7GOQKGQEPWKAFZY@isocpp.org Thu Jul 10 11:29:22 2014
Return-path: <std-proposals+bncBDNPVXXG6IGBB3VZ7GOQKGQEPWKAFZY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f69.google.com ([209.85.220.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDNPVXXG6IGBB3VZ7GOQKGQEPWKAFZY@isocpp.org>)
	id 1X5AfI-0003CE-MX
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Jul 2014 11:29:21 +0200
Original-Received: by mail-pa0-f69.google.com with SMTP id kq14sf58266840pab.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 10 Jul 2014 02:29:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=EQ8O3Wx5s3tWLNpDaQqsbjZdL6E7eJU0X8SyDFJq9g0=;
        b=LcIb0kLMCZZ3xYHmz+JDiHWPUly7WgtJ3bkccwBUORmKLZZnMfLFXaQXz0lQtwGr0k
         UjP4y6wTvhVGWrzC4lkcako9hSRpbTAeJo5EMgIH1n+iPOdVf4iDS4ACHMhUpowW7BOs
         vsL3KAzE1Ui9rOYXAG2oLgjU6L56SA17HN9+Twf2WyKyYRTPmjlUo1d93hhXdUiA45LV
         gf9sjPgxxRd3McN1MqlwZw98AsTqkTdvZ7/rmeP8X/qMUPXadJAF9eG6oOPa+QSYOBHU
         OzNk8ZtRPW3ofJhf7wE1xFLHNcEqCqD9wiJDDlKW9swk9/Slffv0fb+PHr7YPdM3UjhP
         a93Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=EQ8O3Wx5s3tWLNpDaQqsbjZdL6E7eJU0X8SyDFJq9g0=;
        b=EgfQ/8jf3rWoQY+whwlFybMyCQ8RIxv28kDfqYaimjKSSx/cTmJcaVDtJjUCtjA/AQ
         /HabFYgcrIgL4mp3w7pO/BR+EBN3+GDXIx6WQmqdmjeg3D8TlSCMfr4TaR8vVkIguA2R
         UnRXdkujSN1MBoA4MMrHldiTwQHANcIvcAG0p6QrKhxQd3QfgxX9549PxFrmAmm+URfm
         Of+PEU79qk+Efo1dpStwG1dKgRSZNjxbUuKNXb/SAhp7s+/oFgx45xTley3iHdm/zZV7
         SF28encisGSA/hi7shbDhRR3KJi1NOW4nJvJP5f7cR1AC1sUg9WkjLPy1dQTpmxlnZNV
         gnNw==
X-Gm-Message-State: ALoCoQmIqDdRpeusL8vldGYfSnOSI4jnAKfYGPs/EZbXqvqUPhAsoFXZ2vxf4eSz//nNN0bqU7Zq
X-Received: by 10.66.182.130 with SMTP id ee2mr8443270pac.37.1404984559209;
        Thu, 10 Jul 2014 02:29:19 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.109.137 with SMTP id hs9ls22312obb.86.gmail; Thu, 10 Jul
 2014 02:29:18 -0700 (PDT)
X-Received: by 10.182.236.37 with SMTP id ur5mr147628obc.19.1404984558140;
        Thu, 10 Jul 2014 02:29:18 -0700 (PDT)
In-Reply-To: <6F4B3C72-9962-48DC-8527-0C89EA1B9710@gmail.com>
X-Original-Sender: tomaszkam@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:11800
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11800>

------=_Part_82_21799650.1404984557394
Content-Type: text/plain; charset=UTF-8

To be clear, the value function definied in the following text has 
following definition before the change:
  T& value();
  T const& value() const;
This function depsite the name does not return anything by value and haser 
the same relaction with operator*, like operator[] with at in vector.

In the paper that I mentonied in original post following overloads was 
added:
  T& value() &;
  T const& value() const &;
  T value() &&;
  T value() const &&;
Which makes following invoaction f(expr.value()) where takes T by const& 
and expr is value of type optional<T>, introducing has additonal 
possibly-copy dependin on expr being lvalue or r-value. And makes using 
optional in generic context when perfect forwardin us used a pain. I 
propose to set of methods to look like:
  T& value() &;
  T const& value() const &;
  T&& value() &&;
 To achieve consistency with std::get function or even simple meber acces 
with procudes same cateogry value for subobject.

If the original set  of the methods was:
  T  value() const;
I would arrge tthe the new function should be declared as:
  T  value() const;
  T  value() &&;
But this is not 

-- 

--- 
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_82_21799650.1404984557394
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">To be clear, the value function definied in the following =
text has following definition before the change:<br>&nbsp; T&amp; value();<=
br>&nbsp; T const&amp; value() const;<br>This function depsite the name doe=
s not return anything by value and haser the same relaction with operator*,=
 like operator[] with at in vector.<br><br>In the paper that I mentonied in=
 original post following overloads was added:<br>&nbsp;  T&amp; value() &am=
p;;<br>&nbsp; T const&amp; value() const &amp;;<br>&nbsp; T value() &amp;&a=
mp;;<br>&nbsp; T value() const &amp;&amp;;<br>Which makes following invoact=
ion f(expr.value()) where takes T by const&amp; and expr is value of type o=
ptional&lt;T&gt;, introducing has additonal possibly-copy dependin on expr =
being lvalue or r-value. And makes using optional in generic context when p=
erfect forwardin us used a pain. I propose to set of methods to look like:<=
br>&nbsp;  T&amp; value() &amp;;<br>&nbsp; T const&amp; value() const &amp;=
;<br>&nbsp; T&amp;&amp; value() &amp;&amp;;<br>&nbsp;To achieve consistency=
 with std::get function or even simple meber acces with procudes same cateo=
gry value for subobject.<br><br>If the original set&nbsp; of the methods wa=
s:<br>&nbsp; T&nbsp; value() const;<br>I would arrge tthe the new function =
should be declared as:<br>&nbsp; T&nbsp; value() const;<br>&nbsp; T&nbsp; v=
alue() &amp;&amp;;<br>But this is not <br></div>

<p></p>

-- <br />
<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 <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 />
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 />

------=_Part_82_21799650.1404984557394--

.
