220 4744 <51A6F02D.3080901@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: N3558 :A standardized representation of
 Asynchronous operations
Date: Thu, 30 May 2013 08:22:37 +0200
Lines: 155
Approved: news@gmane.org
Message-ID: <51A6F02D.3080901@wanadoo.fr>
References: <519F9E48.7050700@wanadoo.fr> <c959abc7-55a0-4a6a-9b20-9752cbe63af0@isocpp.org> <519FB94F.7090703@wanadoo.fr> <CAGg_6+N60LQLUXvkzY_4-8=-OuBQ-s+n4GttmNTKm7VMc8vfuA@mail.gmail.com> <51A0ADAE.5030908@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------030302040001070303020701"
X-Trace: ger.gmane.org 1369894960 6145 80.91.229.3 (30 May 2013 06:22:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 30 May 2013 06:22:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBBLXATOGQKGQEEIECNNI@isocpp.org Thu May 30 08:22:40 2013
Return-path: <std-proposals+bncBDH67CONY4PBBLXATOGQKGQEEIECNNI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f197.google.com ([209.85.217.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBBLXATOGQKGQEEIECNNI@isocpp.org>)
	id 1UhwFz-00084d-5i
	for gclcip-std-proposals@m.gmane.org; Thu, 30 May 2013 08:22:39 +0200
Original-Received: by mail-lb0-f197.google.com with SMTP id 10sf212240lbf.4
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 May 2013 23:22:38 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:message-id:date:from:user-agent:mime-version:to:subject
         :references:in-reply-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=1yY3c6qSsQXMmM7U4FxTzTs6Q4JnFb9Zmv6ccxDOVQM=;
        b=B8Ty+TxpFFZrhgrF8Dh5gtTauI0S9Y0JLF2bz/CLvnIplQtFe8oMEjX31lyegQqqhZ
         kA3dzFkqpFAmbJuJ+Rg6H+YgAJ8byF7tPMZJmw7iOmyVWx7kj3nhpvM5MMUx8b1bgLFR
         4I6RyULCcK2c9sxqPqTlpBLP9pmF7x8kVT5EZKi9rUhzikbI3wX1mU1E9qR572Yvn/oC
         fj1hNkL1Y9SJoo7EKeLV5kdP+89deChsnCZTILaoVNM5w1DcCB4aJd1rw9XsGKwmF5NN
         awvLp5EsKLhJBfB6dpH93W5w9Wg0E0x+p7P8Bzi8P71Ezx8+oJZMvryXYSgE4YDz9ex2
         rh8g==
X-Received: by 10.180.76.76 with SMTP id i12mr2014305wiw.6.1369894958599;
        Wed, 29 May 2013 23:22:38 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.108.135 with SMTP id hk7ls137069wib.54.gmail; Wed, 29 May
 2013 23:22:37 -0700 (PDT)
X-Received: by 10.194.110.133 with SMTP id ia5mr3057665wjb.35.1369894957631;
        Wed, 29 May 2013 23:22:37 -0700 (PDT)
Original-Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr. [80.12.242.128])
        by mx.google.com with ESMTP id uy3si7668693wjc.129.2013.05.29.23.22.37
        for <std-proposals@isocpp.org>;
        Wed, 29 May 2013 23:22:37 -0700 (PDT)
Received-SPF: neutral (google.com: 80.12.242.128 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.128;
Original-Received: from pc4.home ([2.11.193.225])
	by mwinf5d41 with ME
	id i6Nd1l0024sEqES036NdoJ; Thu, 30 May 2013 08:22:37 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
In-Reply-To: <51A0ADAE.5030908@wanadoo.fr>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.128 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mail=vicente.botet@wanadoo.fr
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?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4744
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4744>

This is a multi-part message in MIME format.
--------------030302040001070303020701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 25/05/13 14:25, Vicente J. Botet Escriba a =E9crit :
> Le 24/05/13 22:24, Nevin Liber a =E9crit :
>> On 24 May 2013 14:02, Vicente J. Botet Escriba=20
>> <vicente.botet@wanadoo.fr <mailto:vicente.botet@wanadoo.fr>> wrote:
>>
>>
>>     Returning future<pair<size_t, vector<future<R>>>> would provide
>>     efficiency and safety.
>>
>>
>> If you are going to go this route, please don't use pair.  It is much=20
>> better to have field names that mean something.
>
> I agree that using accessors would be more readable, hide the=20
> representation and in addition it could provide a value function that=20
> would retrieve the first value set. The quiz would be to find a name=20
> for the class providing these accessors ;-)  Any suggestion is welcome.
>
> template <typename R>
> class ???
> {
> public:
>   vector<future<R> vector() && noexcept;
>   R value() &;
> };
>
> auto f =3D when_any(f1, f2);
> ...
> int i =3D f.get().value(); // efficiency
> vector<future<R> v =3D f.get().vector(); // safety
>
> The following is safe as the futures are transfered to the new variable
>   auto f =3D when_any(f1, f2).to_vector();
>
> But should the following compile
>   int i =3D when_any(f1, f2).value();
>
> With the following declaration the preceding statement must fail at=20
> compile time, isn't it?
>   R value() &;
>
>
Any comments from the authors?

Vicente

--=20

---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.



--------------030302040001070303020701
Content-Type: text/html; charset=ISO-8859-1

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Le 25/05/13 14:25, Vicente J. Botet
      Escriba a &eacute;crit&nbsp;:<br>
    </div>
    <blockquote cite="mid:51A0ADAE.5030908@wanadoo.fr" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Le 24/05/13 22:24, Nevin Liber a
        &eacute;crit&nbsp;:<br>
      </div>
      <blockquote
cite="mid:CAGg_6+N60LQLUXvkzY_4-8=-OuBQ-s+n4GttmNTKm7VMc8vfuA@mail.gmail.com"
        type="cite">On 24 May 2013 14:02, Vicente J. Botet Escriba <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:vicente.botet@wanadoo.fr" target="_blank">vicente.botet@wanadoo.fr</a>&gt;</span>
        wrote:<br>
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"><br>
              Returning future&lt;pair&lt;size_t,
              vector&lt;future&lt;R&gt;&gt;&gt;&gt; would provide
              efficiency and safety.<span class="HOEnZb"></span><br>
            </div>
          </blockquote>
        </div>
        <br clear="all">
        If you are going to go this route, please don't use pair.&nbsp; It is
        much better to have field names that mean something.<br>
      </blockquote>
      <br>
      I agree that using accessors would be more readable, hide the
      representation and in addition it could provide a value function
      that would retrieve the first value set. The quiz would be to find
      a name for the class providing these accessors ;-)&nbsp; Any suggestion
      is welcome.<br>
      <br>
      template &lt;typename R&gt;<br>
      class ???<br>
      {<br>
      public:<br>
      &nbsp; vector&lt;future&lt;R&gt; vector() &amp;&amp; noexcept;<br>
      &nbsp; R value() &amp;;<br>
      };<br>
      <br>
      auto f = when_any(f1, f2);<br>
      ...<br>
      int i = f.get().value(); // efficiency<br>
      vector&lt;future&lt;R&gt; v = f.get().vector(); // safety<br>
      <br>
      The following is safe as the futures are transfered to the new
      variable<br>
      &nbsp; auto f = when_any(f1, f2).to_vector();<br>
      <br>
      But should the following compile<br>
      &nbsp; int i = when_any(f1, f2).value();<br>
      <br>
      With the following declaration the preceding statement must fail
      at compile time, isn't it?<br>
      &nbsp; R value() &amp;;<br>
      <br>
      <br>
    </blockquote>
    Any comments from the authors?<br>
    <br>
    Vicente<br>
  </body>
</html>

<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 email 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="http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en">http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en</a>.<br />
&nbsp;<br />
&nbsp;<br />

--------------030302040001070303020701--

.
