220 2259 <CAOHCbithEUfm+w_06V71=hpkqGUJvqiyDFqD7fesfgLy4uUieg@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 11:05:06 -0500
Lines: 56
Approved: news@gmane.org
Message-ID: <CAOHCbithEUfm+w_06V71=hpkqGUJvqiyDFqD7fesfgLy4uUieg@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>
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 1359129913 4386 80.91.229.3 (25 Jan 2013 16:05:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 25 Jan 2013 16:05:13 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQILFWUKRACRUBEXC3M5Y@isocpp.org Fri Jan 25 17:05:31 2013
Return-path: <std-proposals+bncBCUZ5QWKNQILFWUKRACRUBEXC3M5Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vc0-f198.google.com ([209.85.220.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQILFWUKRACRUBEXC3M5Y@isocpp.org>)
	id 1TylmO-0007E7-RB
	for gclcip-std-proposals@m.gmane.org; Fri, 25 Jan 2013 17:05:25 +0100
Original-Received: by mail-vc0-f198.google.com with SMTP id m8sf635636vcd.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 25 Jan 2013 08:05:06 -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=RZJ8RR+Z5Awr4+LBLMst8kV1r3r9H9DLJT3CNSlYoqA=;
        b=K3G8NgeWdA+3FzUkrL/SWEs2DCgPZ60w+ELgkeGLibbhG64VHR1NNq5pWl5BqkUqyb
         atfhRJQJJeyu0JLcYqy22SS1v/yaGPdes9lShyiJ4HowXy4PdHH8XtF2GTFNdCfJxObh
         FsTH+2p37+m+XkAL94WtutgbJ8CcSWah//6sJKqr/kcSKPz3KfIyrwL8ABnPb6cGAsBt
         /wl/dg9DTrZoGOLzepHkxYZlvGsOGBGOEVJGTPPE7ynT0+wFow0ML38TmLhdEbYlU3di
         JpYtsXtocyueEElpFB6QgPrOYaXYq4EY8Myf/Gr/NQIH4QIyj 
X-Received: by 10.236.152.6 with SMTP id c6mr1909886yhk.21.1359129906845;
        Fri, 25 Jan 2013 08:05:06 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.82.19 with SMTP id e19ls203090qey.38.gmail; Fri, 25 Jan
 2013 08:05:06 -0800 (PST)
X-Received: by 10.224.39.210 with SMTP id h18mr6392698qae.15.1359129906535;
        Fri, 25 Jan 2013 08:05:06 -0800 (PST)
X-Received: by 10.224.39.210 with SMTP id h18mr6392697qae.15.1359129906519;
        Fri, 25 Jan 2013 08:05:06 -0800 (PST)
Original-Received: from mail-qc0-f173.google.com (mail-qc0-f173.google.com [209.85.216.173])
        by mx.google.com with ESMTPS id w5si406996qct.101.2013.01.25.08.05.06
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 25 Jan 2013 08:05:06 -0800 (PST)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 209.85.216.173 as permitted sender) client-ip=209.85.216.173;
Original-Received: by mail-qc0-f173.google.com with SMTP id b12so258187qca.18
        for <std-proposals@isocpp.org>; Fri, 25 Jan 2013 08:05:06 -0800 (PST)
X-Received: by 10.49.12.138 with SMTP id y10mr7273592qeb.64.1359129906276;
 Fri, 25 Jan 2013 08:05:06 -0800 (PST)
Original-Received: by 10.49.87.168 with HTTP; Fri, 25 Jan 2013 08:05:06 -0800 (PST)
In-Reply-To: <ef15483d-5665-4da3-9b79-aefd3c725e1b@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.173 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:2259
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2259>

On Fri, Jan 25, 2013 at 1:55 AM, Nicol Bolas <jmckesson@gmail.com> wrote:
>
>
> On Thursday, January 24, 2013 8:56:08 PM UTC-8, Tony V E wrote:
>>
>> On Thu, Jan 24, 2013 at 7:10 PM, Dean Michael Berris <dbe...@google.com>
>> wrote:
>> >
>> > In my opinion:
>> >
>> > - There's a precedent in other languages for a ".get(default_value)".
>> > Why don't we have this for optional instead?
>> >
>>
>> opt.get(17) doesn't look like it is using a default to me.  Typically
>> get(17) is get the 17th element or lookup with key = 17, etc.
>>
>>
>> > - Why are we forcing pointer semantics on optional? Maybe there's a
>> > different concept here at play.
>> >
>>
>> Because much of optional's interface is similar to pointers:  you
>> access the value with *opt and opt can be NULL.
>>
>> That is the essential "problem" with optional.  Sometimes it acts
>> value-ish, sometimes pointer-ish.  It is like quantum physics -
>> sometimes a particle, sometimes a wave...
>
>
> But it doesn't act like a pointer. Indeed, the *only* thing "pointer-ish"
> about it is that it has an `operator*`. In every other way, it acts like a
> value.

And can be NULL.

It has value semantics, for the most part (ie besides the null), but
pointer syntax.

That's not necessarily wrong, but I do think it is and the heart of
many of the questions/issues.

>
> If it helps limit confusion, we could get rid of `operator*`.
>

-- 

--- 
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.



.
