220 2221 <CAOHCbivAK0ypmMhrhJ3zKpF8BHu3h_rUNzeao-HnibJkC-qqGw@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: Thu, 24 Jan 2013 23:56:08 -0500
Lines: 35
Approved: news@gmane.org
Message-ID: <CAOHCbivAK0ypmMhrhJ3zKpF8BHu3h_rUNzeao-HnibJkC-qqGw@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>
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 1359089769 5041 80.91.229.3 (25 Jan 2013 04:56:09 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 25 Jan 2013 04:56:09 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQIOTIEIRACRUBAFUC4Z6@isocpp.org Fri Jan 25 05:56:28 2013
Return-path: <std-proposals+bncBCUZ5QWKNQIOTIEIRACRUBAFUC4Z6@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f200.google.com ([209.85.128.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIOTIEIRACRUBAFUC4Z6@isocpp.org>)
	id 1TybL2-0001Eh-5P
	for gclcip-std-proposals@m.gmane.org; Fri, 25 Jan 2013 05:56:28 +0100
Original-Received: by mail-ve0-f200.google.com with SMTP id 15sf2658462vea.7
        for <gclcip-std-proposals@m.gmane.org>; Thu, 24 Jan 2013 20:56:10 -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=VNYqrUMWnztrl1/cVyOx8YkdHwkBaBjWkA5Td2Nt05w=;
        b=g5BGvSxJg2ykbyuOczMcCeaQFrsh4DCkNS/fQFnNtT14pgyU/QSx/VW/d4Hpqn+vRF
         KmvsG1NQzZv6sdd5gSh6TxJkTq8Al6Q3L2FrtsnxKZYMtHqVNvtQK4jbMW+7q/wT155l
         OuKKgayy5H5U08YdC/bumh1Ishp7hGp+8vYM/iB6XSpMD3f92FnxOkP5iLiaLL0xaC4Y
         lbyUZPScGm/d5Tz7q//Iegn4P61BBldpWcJOdhAu/kHouc0KKOpuTWvJ9n718TqjL912
         LMKW8R4iotwcgFKgwQSfca3ywUAA/Ci/ACeTHliwgc1gnHlph 
X-Received: by 10.224.175.65 with SMTP id w1mr2241988qaz.7.1359089770112;
        Thu, 24 Jan 2013 20:56:10 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.0.212 with SMTP id 20ls85933qeg.12.gmail; Thu, 24 Jan 2013
 20:56:09 -0800 (PST)
X-Received: by 10.224.110.1 with SMTP id l1mr4585109qap.21.1359089769249;
        Thu, 24 Jan 2013 20:56:09 -0800 (PST)
X-Received: by 10.224.110.1 with SMTP id l1mr4585107qap.21.1359089769229;
        Thu, 24 Jan 2013 20:56:09 -0800 (PST)
Original-Received: from mail-qc0-f177.google.com (mail-qc0-f177.google.com [209.85.216.177])
        by mx.google.com with ESMTPS id gb1si20314005qab.103.2013.01.24.20.56.09
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 24 Jan 2013 20:56:09 -0800 (PST)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 209.85.216.177 as permitted sender) client-ip=209.85.216.177;
Original-Received: by mail-qc0-f177.google.com with SMTP id u28so1098946qcs.36
        for <std-proposals@isocpp.org>; Thu, 24 Jan 2013 20:56:09 -0800 (PST)
X-Received: by 10.224.177.72 with SMTP id bh8mr4559915qab.49.1359089769103;
 Thu, 24 Jan 2013 20:56:09 -0800 (PST)
Original-Received: by 10.49.87.168 with HTTP; Thu, 24 Jan 2013 20:56:08 -0800 (PST)
In-Reply-To: <CALJmx62zJd_tZ=XYL7TaSkRN6432SObwH9YS87eLX-h_pMuFYQ@mail.gmail.com>
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.177 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:2221
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2221>

On Thu, Jan 24, 2013 at 7:10 PM, Dean Michael Berris <dberris@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...

Tony

-- 

--- 
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 email 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-proposals/?hl=en.



.
