220 2210 <CALJmx62zJd_tZ=XYL7TaSkRN6432SObwH9YS87eLX-h_pMuFYQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Dean Michael Berris <dberris@google.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional<T>, one more value or two states
Date: Fri, 25 Jan 2013 11:10:52 +1100
Lines: 79
Approved: news@gmane.org
Message-ID: <CALJmx62zJd_tZ=XYL7TaSkRN6432SObwH9YS87eLX-h_pMuFYQ@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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1359072654 30558 80.91.229.3 (25 Jan 2013 00:10:54 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 25 Jan 2013 00:10:54 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCD3FSEO4IDBBDM3Q6EAKGQEF4TQZXA@isocpp.org Fri Jan 25 01:11:13 2013
Return-path: <std-proposals+bncBCD3FSEO4IDBBDM3Q6EAKGQEF4TQZXA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f198.google.com ([209.85.214.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCD3FSEO4IDBBDM3Q6EAKGQEF4TQZXA@isocpp.org>)
	id 1TyWsx-0005ug-Mh
	for gclcip-std-proposals@m.gmane.org; Fri, 25 Jan 2013 01:11:12 +0100
Original-Received: by mail-ob0-f198.google.com with SMTP id dn14sf6845336obc.1
        for <gclcip-std-proposals@m.gmane.org>; Thu, 24 Jan 2013 16:10:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.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:content-transfer-encoding;
        bh=xnftZ+5qbF0mRZZPzRZbbr9WJB6Y2c8nwhR6zL4GCSk=;
        b=fGB37ES7P97FTJRt9QFgSa/kVA1gQMPdbzEjo/JZ/v7rwTBHj0+BDrIWngOWxgKC41
         Y1mvOfP60IPrmuVB1DpeKsCo0KsJ8DzdOGGorycbUc0hwX74yQlLZARtECglWlnS0mfQ
         S5gJXM83BoZIDRebLEj2sDBs3BMneLxCZ8L7jcJq58bDWlpbnkZNrMMWiXUaQhN/n/xN
         WjTWOj14fqcOZETvl9Z2rwPnc8NVuI1POBZuwWSJTc6PdAY7mNsU3loBQtNQiIN4nRM+
         1O8aiFeMWFylFV876yWUgu 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.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-gm-message-state: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
         :content-transfer-encoding;
        bh=xnftZ+5qbF0mRZZPzRZbbr9WJB6Y2c8nwhR6zL4GCSk=;
        b=mUsk8Sm0rbIJgmK0o6URbSYviXMWK/fCj/5TNPXTYNtdOOKtEz2PxMQmBoWL3iNhQA
         01SkbKzOmD6ZBd26hpRngSXi+xAHAsI266S8BJtGNAC2uBkQ4PLUGu/Me+JAlEJqdPIY
         2zM0t+sk/jyvRSvct7j/4wPM7PxJvUFMgm42IGYLxvNbOQBdRd0QalTOQ6ghdFDkVRTC
         Cmu+5PEhno7aFZlZ0RLpPwcQ+p3kRgzuQUSI/+UDMbL1ISTcL/OBscJPhuRt0y 
X-Received: by 10.42.212.209 with SMTP id gt17mr2503065icb.31.1359072653572;
        Thu, 24 Jan 2013 16:10:53 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.153.201 with SMTP id vi9ls37721igb.40.gmail; Thu, 24 Jan
 2013 16:10:53 -0800 (PST)
X-Received: by 10.42.57.11 with SMTP id b11mr2438870ich.15.1359072652950;
        Thu, 24 Jan 2013 16:10:52 -0800 (PST)
X-Received: by 10.42.57.11 with SMTP id b11mr2438869ich.15.1359072652933;
        Thu, 24 Jan 2013 16:10:52 -0800 (PST)
Original-Received: from mail-ia0-x236.google.com (mail-ia0-x236.google.com [2607:f8b0:4001:c02::236])
        by mx.google.com with ESMTPS id q4si3028915igl.51.2013.01.24.16.10.52
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 24 Jan 2013 16:10:52 -0800 (PST)
Received-SPF: pass (google.com: domain of dberris@google.com designates 2607:f8b0:4001:c02::236 as permitted sender) client-ip=2607:f8b0:4001:c02::236;
Original-Received: by mail-ia0-f182.google.com with SMTP id w33so5675555iag.41
        for <std-proposals@isocpp.org>; Thu, 24 Jan 2013 16:10:52 -0800 (PST)
X-Received: by 10.50.189.193 with SMTP id gk1mr2909056igc.87.1359072652734;
 Thu, 24 Jan 2013 16:10:52 -0800 (PST)
Original-Received: by 10.231.132.65 with HTTP; Thu, 24 Jan 2013 16:10:52 -0800 (PST)
In-Reply-To: <CAPXezF_JggyMaXjGS9r1EAGVu1NhQBEyGEXB8tKmVqgFfjoCeg@mail.gmail.com>
X-Gm-Message-State: ALoCoQnKnUMfp4OXBUpcAgse4zkC4y8HH7SNDr3ykW5FThfa0kRvIHycWwpdoyGtP2YowxG96TxbLmjFkRbfuuAMgB/KP/Rl27/tCg8c+OIQkkz/t4fonCw2SwmCcSE+Sg8naoM8wLV6vdm+jwzCAFmAZ44JrNmdG9Py5NO+eCu4TEqC6NfHskCtATzA0qhJEcJuTTXKg745
X-Original-Sender: dberris@google.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of dberris@google.com designates 2607:f8b0:4001:c02::236 as permitted
 sender) smtp.mail=dberris@google.com;       dkim=pass header.i=@google.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:2210
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2210>

On Fri, Jan 25, 2013 at 7:07 AM, Fernando Cacciola
<fernando.cacciola@gmail.com> wrote:
> On Thu, Jan 24, 2013 at 12:22 PM, Andrzej Krzemie=F1ski
> <akrzemi1@gmail.com> wrote:
>>
>>
>> W dniu czwartek, 24 stycznia 2013 14:52:22 UTC+1 u=BFytkownik Zhihao Yua=
n
>> napisa=B3:
>>>
>>> On Thu, Jan 24, 2013 at 7:38 AM, Ville Voutilainen
>>> <ville.vo...@gmail.com> wrote:
>>> > I have since cured that problem in my head, there's no 'danger' invol=
ved
>>> > in
>>> > it.
>>>
>>> The danger already shows up.
>>>
>>> Quoting from the proposal:
>>>
>>>   "Such implicit conversions impose some risk of introducing bugs,
>>>    and in fact in order to avoid one such possible bug we had to 'poiso=
n'
>>>    comparisons between optional<T> and T."
>>>
>>> And a carefully specified comparison logic is under discussion.
>>
>>
>> The perceived danger is the opinion of the authors (myself included).
>
> To be honest, it is more that I was sold into it :)
>
> Again if it where entirely up to me, I would put this back in as well
> as mixed comparison operators.
>
> So, it's once a again more of a matter of gauging the probable
> reaction among voting committee members.
>

In my opinion:

- There's a precedent in other languages for a ".get(default_value)".
Why don't we have this for optional instead?

- Why are we forcing pointer semantics on optional? Maybe there's a
different concept here at play.

- As a value type I would be very leery of mixing comparison
operators. Think about how NaN already works in terms of comparison
with float/doubles. It would be surprising to have an optional value
be comparable to a non-optional value.

- Implicit conversion: no confusion here, it's convenient and simple.
If a function takes a optional<T> and you gave it '{}' then you should
expect a default-constructed optional<T> (disengaged). It doesn't make
sense for that optional to be comparable to a non-optional (or
actually even to another optional). The values very well may be
comparable in which case you just compare the values if there are
values to compare.

All I'm reading so far as been "I don't like this" or "I don't prefer
this". I have not seen any sound logical reasoning to say that
anything thus far being presented is illogical or "does not make
sense".

--=20

---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.



.
