220 7040 <CAFk2RUbH_uvpq1JBJ6NX3QenwTCH1LXb0DvKHUQO3N3BM97nVA@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: More converting constructors for Optional
Date: Sat, 5 Oct 2013 22:30:10 +0300
Lines: 91
Approved: news@gmane.org
Message-ID: <CAFk2RUbH_uvpq1JBJ6NX3QenwTCH1LXb0DvKHUQO3N3BM97nVA@mail.gmail.com>
References: <417ebcd9-ff0b-49d8-b055-bd098e97dddc@isocpp.org>
	<CAFk2RUbh7yMESeYFRFr+OiEz4FK_EPv+4dUSzA3UDWQbyz+hQw@mail.gmail.com>
	<f966afd6-75e5-4970-9d0f-0f8ffac5efe1@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c25b4881dde504e8037292
X-Trace: ger.gmane.org 1381001408 28381 80.91.229.3 (5 Oct 2013 19:30:08 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 5 Oct 2013 19:30:08 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBQWRYGJAKGQEOV3CJKQ@isocpp.org Sat Oct 05 21:30:12 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBQWRYGJAKGQEOV3CJKQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f70.google.com ([74.125.82.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBQWRYGJAKGQEOV3CJKQ@isocpp.org>)
	id 1VSXYJ-0001e1-OV
	for gclcip-std-proposals@m.gmane.org; Sat, 05 Oct 2013 21:30:11 +0200
Original-Received: by mail-wg0-f70.google.com with SMTP id m15sf6830849wgh.5
        for <gclcip-std-proposals@m.gmane.org>; Sat, 05 Oct 2013 12:30:11 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=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=rHDSDisLZzdGUNg4Q9OzI8AozonPa08OcWgct5mVneY=;
        b=Bz3hB5WGvOrHA91CMbd2CmgytI4oqhcmrBnBRcEZ5JjHgrd4AqUurxdOpHI+phnV45
         1u3pyNZHVQqpzZOVW/g1Euv7kZOMlcA0KRmrqJ216NcYKq/X3sSLodl86voTp7F7vVDV
         AyyI2ievshEYxIWuoqxbUEK88rSvRavxkrnQfi+vR0kQihKRkyQs/Cl/1jjd7m4RKjUE
         xqsKlWhKCdeDImL8TsIvzNj7C3hndaNDCEEJ3sW/ysM4Ne4w+AvEQYr4In56tjAjhQOI
         gHR6hExJo3iwWtSHv9QdHKJBrxB9GguGlgI0me/sCaduFNQFmvym5hypbiDehXEcnqW5
         TJNQ==
X-Received: by 10.180.109.19 with SMTP id ho19mr5869695wib.7.1381001411267;
        Sat, 05 Oct 2013 12:30:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.88.39 with SMTP id bd7ls574719wib.47.canary; Sat, 05 Oct
 2013 12:30:10 -0700 (PDT)
X-Received: by 10.180.10.8 with SMTP id e8mr12429852wib.65.1381001410600;
        Sat, 05 Oct 2013 12:30:10 -0700 (PDT)
Original-Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [2a00:1450:400c:c05::233])
        by mx.google.com with ESMTPS id w2si8004087wjz.136.1969.12.31.16.00.00
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 05 Oct 2013 12:30:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2a00:1450:400c:c05::233 as permitted sender) client-ip=2a00:1450:400c:c05::233;
Original-Received: by mail-wi0-f179.google.com with SMTP id hm2so3141221wib.6
        for <std-proposals@isocpp.org>; Sat, 05 Oct 2013 12:30:10 -0700 (PDT)
X-Received: by 10.180.11.37 with SMTP id n5mr12293233wib.25.1381001410500;
 Sat, 05 Oct 2013 12:30:10 -0700 (PDT)
Original-Received: by 10.194.42.70 with HTTP; Sat, 5 Oct 2013 12:30:10 -0700 (PDT)
In-Reply-To: <f966afd6-75e5-4970-9d0f-0f8ffac5efe1@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 2a00:1450:400c:c05::233 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:7040
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7040>

--001a11c25b4881dde504e8037292
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 5 October 2013 22:05, Andrzej Krzemie=C5=84ski <akrzemi1@gmail.com> wrot=
e:

>
> Oh, you spotted a different problem than I did. Mine was that (even if I
> fixed yours) it is not clear how to handle a case where *T* has a
> constructor taking another optional. Consider a more tricky type:
>
> *  struct Port
>   {
> *
> *    Port (optional<int> oi);
>     Port (int);
>   };
> *
>
> And now the code that uses it:
>
>
> *  optional<int> oi;
> **  optional<Port> op =3D oi;*
>
> Now, forget how optional is or might be implemented. As a user, which
> constructor of *Port *would you expect to be called?
>
>
The one taking optional<int>, since optional doesn't automatically convert
to an int. If you
have
int i;
optional<Port> op =3D i;
then I expect Port(int) to be used.

--=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/.

--001a11c25b4881dde504e8037292
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 5 October 2013 22:05, Andrzej Krzemie=C5=84ski <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:akrzemi1@gmail.com" target=3D"_blank">akrzemi1@gmail=
..com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>Oh, you spotted a =
different problem than I did. Mine was that (even if I fixed yours) it is n=
ot clear how to handle a case where <b>T</b> has a constructor taking anoth=
er optional. Consider a more tricky type:<br>
<br><b>=C2=A0 struct Port<br>=C2=A0 {<br></b><div><b>=C2=A0=C2=A0=C2=A0 Por=
t (optional&lt;int&gt; oi);<br>=C2=A0=C2=A0=C2=A0 Port (int);<br>
=C2=A0 }; <br></b></div><br>And now the code that uses it:<div class=3D"im"=
><br><br><b>=C2=A0 optional&lt;int&gt; oi;<br></b><b>=C2=A0 optional&lt;Por=
t&gt; op =3D oi;</b><br><br></div>Now, forget how optional is or might be i=
mplemented. As a user, which constructor of <b>Port </b>would you expect to=
 be called?<br>
<br></div></div></blockquote><div><br></div><div>The one taking optional&lt=
;int&gt;, since optional doesn&#39;t automatically convert to an int. If yo=
u<br></div><div>have<br></div><div>int i;<br>optional&lt;Port&gt; op =3D i;=
<br>
</div><div>then I expect Port(int) to be used.<br></div></div><br></div></d=
iv>

<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 e=
mail 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=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c25b4881dde504e8037292--

.
