220 2275 <CAOHCbivJzdQbe22URgRuahCYYDPG8Ygsc4VG7f61zRBWXogekg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Tony V E <tvaneerd@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional<T>, one more value or two states
Date: Fri, 25 Jan 2013 17:09:20 -0500
Lines: 38
Approved: news@gmane.org
Message-ID: <CAOHCbivJzdQbe22URgRuahCYYDPG8Ygsc4VG7f61zRBWXogekg@mail.gmail.com>
References: <CAGsORuC1ADLXgS9AZZiTo=knmhT-+9Yj+82v+b8Nq_WJpb1fOg@mail.gmail.com>
	<CAFk2RUZyZA0LLUNuVNcnibv+qBF69jMytWQL3tkp-Kp21oEU+A@mail.gmail.com>
	<CAGsORuB-Qkx-LaXj2jO4yLrwN524kiJONSg7oczkQZHYaJ6ASg@mail.gmail.com>
	<d360a952-28ae-4d57-bb20-96fd08725a0b@isocpp.org>
	<CAPXezF_JggyMaXjGS9r1EAGVu1NhQBEyGEXB8tKmVqgFfjoCeg@mail.gmail.com>
	<CALJmx62zJd_tZ=XYL7TaSkRN6432SObwH9YS87eLX-h_pMuFYQ@mail.gmail.com>
	<CAOHCbivAK0ypmMhrhJ3zKpF8BHu3h_rUNzeao-HnibJkC-qqGw@mail.gmail.com>
	<ef15483d-5665-4da3-9b79-aefd3c725e1b@isocpp.org>
	<CAOHCbithEUfm+w_06V71=hpkqGUJvqiyDFqD7fesfgLy4uUieg@mail.gmail.com>
	<2c2b9360-8e5e-422d-9b85-124bd947b004@isocpp.org>
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 1359151762 20190 80.91.229.3 (25 Jan 2013 22:09:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 25 Jan 2013 22:09:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQIJBBMMRACRUBHPGSAJM@isocpp.org Fri Jan 25 23:09:42 2013
Return-path: <std-proposals+bncBCUZ5QWKNQIJBBMMRACRUBHPGSAJM@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f198.google.com ([209.85.128.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIJBBMMRACRUBHPGSAJM@isocpp.org>)
	id 1TyrSt-00083U-2r
	for gclcip-std-proposals@m.gmane.org; Fri, 25 Jan 2013 23:09:39 +0100
Original-Received: by mail-ve0-f198.google.com with SMTP id ox1sf604450veb.9
        for <gclcip-std-proposals@m.gmane.org>; Fri, 25 Jan 2013 14:09:20 -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:in-reply-to:references: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=V5+X2MN7kPQVClxrvDbojocWokEzDgUrsXE2eQFhljs=;
        b=zQRQODE4Uyacns28Yy7pcPphLRH9bI+ZdQa0nJ80SZCCCyEfD7TuR12+9jTcSImSD2
         GnCyrUuxzoDXixISJ8TksBhaqTokKxhh4XRc2w/NDwKos4WC/eza+RixBpLQpVQjBPeN
         +d1vZqXOGSDgJjdZbFpV8bdCMBelNenjlM3h24IB4R3ql8cPPeuEzIKJfHm+RjUILyez
         yf4PbjiwXjoV01mH1rymP0kbeQrkVN47zREwVxWcUiQj+RkM3feZVvmOXZD4GADEhvnK
         OCmYXSLFtuYV9RXCOFCLi6J0voSkxof+NeebvNAssz2b2PeyZ 
X-Received: by 10.236.152.6 with SMTP id c6mr2378072yhk.21.1359151760698;
        Fri, 25 Jan 2013 14:09:20 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.104.110 with SMTP id gd14ls365448qeb.64.gmail; Fri, 25 Jan
 2013 14:09:20 -0800 (PST)
X-Received: by 10.229.137.1 with SMTP id u1mr1791788qct.86.1359151760338;
        Fri, 25 Jan 2013 14:09:20 -0800 (PST)
X-Received: by 10.229.137.1 with SMTP id u1mr1791787qct.86.1359151760310;
        Fri, 25 Jan 2013 14:09:20 -0800 (PST)
Original-Received: from mail-qa0-f49.google.com (mail-qa0-f49.google.com [209.85.216.49])
        by mx.google.com with ESMTPS id ee3si1667134qab.111.2013.01.25.14.09.20
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 25 Jan 2013 14:09:20 -0800 (PST)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 209.85.216.49 as permitted sender) client-ip=209.85.216.49;
Original-Received: by mail-qa0-f49.google.com with SMTP id r4so1000qaq.1
        for <std-proposals@isocpp.org>; Fri, 25 Jan 2013 14:09:20 -0800 (PST)
X-Received: by 10.49.12.138 with SMTP id y10mr8504024qeb.64.1359151760227;
 Fri, 25 Jan 2013 14:09:20 -0800 (PST)
Original-Received: by 10.49.87.168 with HTTP; Fri, 25 Jan 2013 14:09:20 -0800 (PST)
In-Reply-To: <2c2b9360-8e5e-422d-9b85-124bd947b004@isocpp.org>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of tvaneerd@gmail.com designates 209.85.216.49 as permitted sender)
 smtp.mail=tvaneerd@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:2275
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2275>

On Fri, Jan 25, 2013 at 3:20 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
>> And can be NULL.
>
>
> No, it can be empty, not NULL. `optional` is a container.
>

Well, the container perspective is one way of looking at it, but not
the only one.  Many people have called the concept NullableProxy, and
C# calls their closely related thing Nullable<T>, and it converts to
bool so that if (opt) works, whereas if (container) doesn't, and the
empty optional constructor is called nullopt, not emptyopt,...

Do you think we should back away from all the pointer-ish interface
parts and move more towards container-ish?  Should *opt be opt[0]
instead?  (I'm not being sarcastic, I've really been trying to find
syntax that is more container-ish).

I agree that it is not reference semantics, thus it is drastically
different than pointers in a important, fundamental way, but it does
share other semantics with pointers.  Or, I think equivalently,
pointers share some semantics with containers.  The "empty or not"
semantic.  Just not the ownership semantics.

Is there a difference between empty and null?

Tony

-- 

--- 
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.



.
