220 2123 <CAGsORuC1ADLXgS9AZZiTo=knmhT-+9Yj+82v+b8Nq_WJpb1fOg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Zhihao Yuan <lichray@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: optional<T>, one more value or two states
Date: Thu, 24 Jan 2013 07:25:49 -0600
Lines: 33
Approved: news@gmane.org
Message-ID: <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: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1359033953 12590 80.91.229.3 (24 Jan 2013 13:25:53 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 24 Jan 2013 13:25:53 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUILMGRQMARBX7MQSEAKGQEHHND54Y@isocpp.org Thu Jan 24 14:26:12 2013
Return-path: <std-proposals+bncBCUILMGRQMARBX7MQSEAKGQEHHND54Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-we0-f198.google.com ([74.125.82.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUILMGRQMARBX7MQSEAKGQEHHND54Y@isocpp.org>)
	id 1TyMok-0006Ix-9c
	for gclcip-std-proposals@m.gmane.org; Thu, 24 Jan 2013 14:26:10 +0100
Original-Received: by mail-we0-f198.google.com with SMTP id r1sf5238481wey.5
        for <gclcip-std-proposals@m.gmane.org>; Thu, 24 Jan 2013 05:25:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :mime-version:x-received:date:message-id:subject:from: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=A2U4rgTLgMqnWBenUKuDRNG0unWyVKPrJcPnjx/MxQk=;
        b=YAeYJ8HIhpE7n4kHh7DeEqDN7lvsHjmmKLiClWaMgwDXpsuUKZuUQxjVyjmoBZ1C7K
         /GDr4Amxvlw22WHu7OzC2LwUNp6SQv0enD5FVvG6zu9OA1l2v1Eq+JPBRgBrO+w13pfr
         ahlgHixD9M47NekqdPUNcb7ounSA+txqPmyzk3yh/+3qrgGdMEVX2He7XZbnwcNhWHcp
         dGpmeJLyXL3TeyY1KWk+qzAnD5vO17ZXWU1nOHInAzLXMNi1wQfHzCXjkcPS42ceVPPw
         wH/zFd75v4sKEnkBa5w1wRUzHKAHtwNkMhLjH/7T7U5Sa0Ry8HM+nIzPMIr38ia9vF/C
         Di5w 
X-Received: by 10.112.99.40 with SMTP id en8mr262177lbb.22.1359033952640;
        Thu, 24 Jan 2013 05:25:52 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.135.172 with SMTP id pt12ls34207lab.63.gmail; Thu, 24 Jan
 2013 05:25:50 -0800 (PST)
X-Received: by 10.152.148.4 with SMTP id to4mr1838623lab.39.1359033950140;
        Thu, 24 Jan 2013 05:25:50 -0800 (PST)
X-Received: by 10.152.148.4 with SMTP id to4mr1838621lab.39.1359033950127;
        Thu, 24 Jan 2013 05:25:50 -0800 (PST)
Original-Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176])
        by mx.google.com with ESMTPS id p10si10594631lbb.295.2013.01.24.05.25.50
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 24 Jan 2013 05:25:50 -0800 (PST)
Received-SPF: pass (google.com: domain of lichray@gmail.com designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176;
Original-Received: by mail-lb0-f176.google.com with SMTP id s4so3862071lbc.7
        for <std-proposals@isocpp.org>; Thu, 24 Jan 2013 05:25:50 -0800 (PST)
X-Received: by 10.112.51.175 with SMTP id l15mr810340lbo.5.1359033949211; Thu,
 24 Jan 2013 05:25:49 -0800 (PST)
Original-Received: by 10.112.75.131 with HTTP; Thu, 24 Jan 2013 05:25:49 -0800 (PST)
X-Original-Sender: lichray@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of lichray@gmail.com designates 209.85.217.176 as permitted sender)
 smtp.mail=lichray@gmail.com;       dkim=pass header.i=@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:2123
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2123>

My own point of view:

If optional<T> is an extended type T, then:

optional<int> x = 0;  // implicitly convertible
optional<int>(3) == 3;  // since T is a sub-range of optional<T>
optional<int>(nullopt) == optional<int>(nullopt);  // same extended value

If optional<T> is a T with two states, then:

optional<int> x(0);  // explicitly convertible
optional<int>(3) == make_optional(3);  // since T is not "T with states"
optional<int>(nullopt) != optional<int>(nullopt);  // meaningless states

Comments wanted.


--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

-- 

--- 
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@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



.
