220 11106 <0e4e74ec-09f0-4102-b46b-589949a45519@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: tomaszkam@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: N4015: A proposal to add a utility class to
 represent expected monad
Date: Fri, 6 Jun 2014 02:43:59 -0700 (PDT)
Lines: 87
Approved: news@gmane.org
Message-ID: <0e4e74ec-09f0-4102-b46b-589949a45519@isocpp.org>
References: <94ded66f-1c50-47b9-8a04-b83805443da9@isocpp.org>
 <5380804B.80607@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_178_31535809.1402047839664"
X-Trace: ger.gmane.org 1402048207 15287 80.91.229.3 (6 Jun 2014 09:50:07 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Jun 2014 09:50:07 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDNPVXXG6IGBBYE2Y2OAKGQEMKYWRKQ@isocpp.org Fri Jun 06 11:50:00 2014
Return-path: <std-proposals+bncBDNPVXXG6IGBBYE2Y2OAKGQEMKYWRKQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f200.google.com ([209.85.213.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDNPVXXG6IGBBYE2Y2OAKGQEMKYWRKQ@isocpp.org>)
	id 1Wsqgr-0002Fc-Sg
	for gclcip-std-proposals@m.gmane.org; Fri, 06 Jun 2014 11:44:02 +0200
Original-Received: by mail-ig0-f200.google.com with SMTP id l13sf1884746iga.11
        for <gclcip-std-proposals@m.gmane.org>; Fri, 06 Jun 2014 02:44:00 -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=KGBSJepcknEMLj2k6SdMfRjwwubO1aNnYzxXIxEr/uc=;
        b=Kl6Pq7tGtSA/p16F/UvRvT5pzfmpKsNGN6aQp5kJOGsfUBK3bPD4cA4eUcygyDyVDA
         GxYnmRrEgJfJVns4Rwbv/p3j8IedArNgFto9mqhOmbksu+5hUyQL5pSA8750dBSVlulQ
         o9+UOcIG9+h46w66HUdR28rde3mnPvZjC18Owqu+3Ac9+IZjbH56mpb0SeAeWe50Gvra
         XH0x34HezrWv/5cdiFKG7aui+mcDg0bKKEzapZjUTrbgYkEEUaJsWiIbX2lTb0Rpgn98
         RncbTLvNYKweCIrtEwITprRFnZaXB12bU/qoJboXvFmOK+YeARPRNlkVr9vMFocrte/h
         o5fw==
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=KGBSJepcknEMLj2k6SdMfRjwwubO1aNnYzxXIxEr/uc=;
        b=f/9Ejrz+4NamyNBdk9huYggAQV1YJfDZXv70g39VTw/4tL/qdFSOqH4W/urI+qDG++
         uECPVOirO/HsYP6ZEMijiWmPblJWj5OZerxccmlRr/NkYdp6opjxiDvcY6w1B1e2oFo6
         FePEscntgr05ICNPjKMehkPcYg/yge6L7iCOgmYt3LCAEFY5Fu6dPHLHL9yjNQO7ase0
         hQphCE4fBzohpXARDwo/wDTPHy3Ud+0u+sSOfapBCNoiEEaD9xLRA4HYGg7ZDhgBNm7x
         dXMilYDlSIjDuV63gOb9/YiE3Y3S868dS8P13d0lRtrZHKdNg5TgNXNrh7j3k+HAo5sF
         HSpw==
X-Gm-Message-State: ALoCoQk7ZX2V41POjZvDKQyfOw5++GakbzvDlJ5Pw/+Fu+oLkYbri1fMOjDUuYViD6mr0GVuG6Bj
X-Received: by 10.50.50.178 with SMTP id d18mr1881287igo.2.1402047840896;
        Fri, 06 Jun 2014 02:44:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.25.171 with SMTP id 40ls608776qgt.85.gmail; Fri, 06 Jun
 2014 02:44:00 -0700 (PDT)
X-Received: by 10.140.27.244 with SMTP id 107mr21237qgx.18.1402047840329;
        Fri, 06 Jun 2014 02:44:00 -0700 (PDT)
In-Reply-To: <5380804B.80607@wanadoo.fr>
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: <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:11106
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11106>

------=_Part_178_31535809.1402047839664
Content-Type: text/plain; charset=UTF-8

The original class was defined just as you propose. We moved to the current 
expected<E,T> form to be able to write

>
> auto e  = expected<error_condition>::make(1) // result is 
> expected<error_condition, int>
>
> Others have already do the same remark, and we would not have any problem 
> rolling back to the original design. We will need a different type 
> constructor expected_tc (a better name of course)
>
> auto e  = expected_tc<error_condition>::make(1) // result is 
> expected<error_condition, int 
>
With the original class defintion expected<T,E> you can still achive very 
simliar inteface, by declaring:

template<typename E = exception_ptr, T>
expected<T, E> make_expected(T); //This should use perfect forwarding and 
decay for argument, but it is cleaner that way

Then you will be able to write:
auto a = make_expected(1);                         // result is 
excepted<int>
auto b = make_expected<error_condition>(1);// result is expected<int, 
error_condition>

-- 

--- 
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_178_31535809.1402047839664
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The original class was defined just as you propose. We mov=
ed to the
    current expected&lt;E,T&gt; form to be able to write<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #=
ccc solid;padding-left: 1ex;"><div>
    <br>
    auto e&nbsp; =3D expected&lt;error_condition&gt;::<wbr>make(1) // resul=
t is
    expected&lt;error_condition, int&gt;<br>
    <br>
    Others have already do the same remark, and we would not have any
    problem rolling back to the original design. We will need a
    different type constructor expected_tc (a better name of course)<br>
    <br>
    auto e&nbsp; =3D expected_tc&lt;error_condition&gt;::<wbr>make(1) // re=
sult is
    expected&lt;error_condition, int <br></div></blockquote><div>With the o=
riginal class defintion expected&lt;T,E&gt; you can still achive very simli=
ar inteface, by declaring:<br><br>template&lt;typename E =3D exception_ptr,=
 T&gt;<br>expected&lt;T, E&gt; make_expected(T); //This should use perfect =
forwarding and decay for argument, but it is cleaner that way<br><br>Then y=
ou will be able to write:<br>auto a =3D make_expected(1); &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // resul=
t is excepted&lt;int&gt;<br>auto b =3D make_expected&lt;error_condition&gt;=
(1);// result is
    expected&lt;int, error_condition&gt;<br><br></div></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_178_31535809.1402047839664--

.
