220 2139 <4029e857-26de-43e3-b7af-0c0ace4ff257@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional<T>, one more value or two states
Date: Thu, 24 Jan 2013 08:34:20 -0800 (PST)
Lines: 109
Approved: news@gmane.org
Message-ID: <4029e857-26de-43e3-b7af-0c0ace4ff257@isocpp.org>
References: <CAGsORuC1ADLXgS9AZZiTo=knmhT-+9Yj+82v+b8Nq_WJpb1fOg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_255_1430167.1359045260816"
X-Trace: ger.gmane.org 1359045262 11732 80.91.229.3 (24 Jan 2013 16:34:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 24 Jan 2013 16:34:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDT2DGOJ34DBBDWFQWEAKGQESPLXSZY@isocpp.org Thu Jan 24 17:34:41 2013
Return-path: <std-proposals+bncBDT2DGOJ34DBBDWFQWEAKGQESPLXSZY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f197.google.com ([209.85.214.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDT2DGOJ34DBBDWFQWEAKGQESPLXSZY@isocpp.org>)
	id 1TyPlB-0002kR-6P
	for gclcip-std-proposals@m.gmane.org; Thu, 24 Jan 2013 17:34:41 +0100
Original-Received: by mail-ob0-f197.google.com with SMTP id ta14sf8580992obb.4
        for <gclcip-std-proposals@m.gmane.org>; Thu, 24 Jan 2013 08:34:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:date:from:to:message-id
         :in-reply-to:references:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=ANU8loCnbT96NehT4Ev9qVQAPCnfPdIbB7Cs5gY6eVM=;
        b=0kZcW2zoorkp+NXForUNfj6+ZPTiIDQFda+Q1qhYYPHp09FwESrOETOL9cGtmqHkL8
         EauZ4ExmfDY1486fq9D8RFCwZGd8gN0TjOYD3/vGOnmA0t2BkChNPCAcoHOs4N5Xh2xD
         1e3lnj9nlXVL/qwFPcMNg5Tv1D3bQZiYcPc1WRic+QDlMCs1GG5hfb4wcPkoHFkWir7G
         WMwrlvL1XfAptvNQ2qA2pSdTjm4QW8YPtvpqvZfGqHbA8s0u1SZ96lmDb2xkCk1rkHzE
         rMjFxmm10ylDoPeccAuRCesgojjBXLD36/vVEkMDE4rqi4L/KQEsmiMF5dx6QRhNpXLx
         Qt6A==
X-Received: by 10.42.117.6 with SMTP id r6mr1868959icq.29.1359045263178;
        Thu, 24 Jan 2013 08:34:23 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.17.201 with SMTP id q9ls1049677igd.26.canary; Thu, 24 Jan
 2013 08:34:21 -0800 (PST)
X-Received: by 10.50.108.137 with SMTP id hk9mr752128igb.15.1359045261656;
        Thu, 24 Jan 2013 08:34:21 -0800 (PST)
In-Reply-To: <CAGsORuC1ADLXgS9AZZiTo=knmhT-+9Yj+82v+b8Nq_WJpb1fOg@mail.gmail.com>
X-Original-Sender: akrzemi1@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?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:2139
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2139>

------=_Part_255_1430167.1359045260816
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable



W dniu czwartek, 24 stycznia 2013 14:25:49 UTC+1 u=BFytkownik Zhihao Yuan=
=20
napisa=B3:
>
> My own point of view:=20
>
> If optional<T> is an extended type T, then:=20
>
> optional<int> x =3D 0;  // implicitly convertible=20
> optional<int>(3) =3D=3D 3;  // since T is a sub-range of optional<T>=20
> optional<int>(nullopt) =3D=3D optional<int>(nullopt);  // same extended v=
alue=20
>
> If optional<T> is a T with two states, then:=20
>
> optional<int> x(0);  // explicitly convertible=20
> optional<int>(3) =3D=3D make_optional(3);  // since T is not "T with stat=
es"=20
> optional<int>(nullopt) !=3D optional<int>(nullopt);  // meaningless state=
s=20
>
> Comments wanted.=20
>

Terms "extended type" and "a type with two states" are very confusing for=
=20
me. I am not sure what you mean. Instead, if you asked -- in the spirit of=
=20
n2479 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2479.pdf>--=
 what the set of salient attributes of optional<T> is, the answer is easy.

The salient attributes are:

   1. The engaged/disengaged state
   2. If the optional object is engaged, the value of its 'contained value'=
..
  =20

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To post to this group, send email to std-proposals@isocpp.org.
To unsubscribe from this group, send email to std-proposals+unsubscribe@iso=
cpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/?hl=3Den.



------=_Part_255_1430167.1359045260816
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

<br><br>W dniu czwartek, 24 stycznia 2013 14:25:49 UTC+1 u=BFytkownik Zhiha=
o Yuan napisa=B3:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">My own point =
of view:
<br>
<br>If optional&lt;T&gt; is an extended type T, then:
<br>
<br>optional&lt;int&gt; x =3D 0; &nbsp;// implicitly convertible
<br>optional&lt;int&gt;(3) =3D=3D 3; &nbsp;// since T is a sub-range of opt=
ional&lt;T&gt;
<br>optional&lt;int&gt;(nullopt) =3D=3D optional&lt;int&gt;(nullopt); &nbsp=
;// same extended value
<br>
<br>If optional&lt;T&gt; is a T with two states, then:
<br>
<br>optional&lt;int&gt; x(0); &nbsp;// explicitly convertible
<br>optional&lt;int&gt;(3) =3D=3D make_optional(3); &nbsp;// since T is not=
 "T with states"
<br>optional&lt;int&gt;(nullopt) !=3D optional&lt;int&gt;(nullopt); &nbsp;/=
/ meaningless states
<br>
<br>Comments wanted.
<br></blockquote><div><br>Terms "extended type" and "a type with two states=
" are very confusing for me. I am not sure what you mean. Instead, if you a=
sked -- in the spirit of <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/=
docs/papers/2007/n2479.pdf ">n2479</a> -- what the set of salient attribute=
s of optional&lt;T&gt; is, the answer is easy.<br><br>The salient attribute=
s are:<br><ol><li>The engaged/disengaged state</li><li>If the optional obje=
ct is engaged, the value of its 'contained value'.<br></li></ol></div>

<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 post to this group, send email to std-proposals@isocpp.org.<br />
To unsubscribe from this group, send email to std-proposals+unsubscribe@iso=
cpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_255_1430167.1359045260816--

.
