220 2126 <51013FC6.9080907@bubblescope.net> article
Path: news.gmane.org!not-for-mail
From: Chris Jefferson <chris@bubblescope.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional<T>, one more value or two states
Date: Thu, 24 Jan 2013 14:05:58 +0000
Lines: 42
Approved: news@gmane.org
Message-ID: <51013FC6.9080907@bubblescope.net>
References: <CAGsORuC1ADLXgS9AZZiTo=knmhT-+9Yj+82v+b8Nq_WJpb1fOg@mail.gmail.com> <CAFk2RUZyZA0LLUNuVNcnibv+qBF69jMytWQL3tkp-Kp21oEU+A@mail.gmail.com> <CAGsORuB-Qkx-LaXj2jO4yLrwN524kiJONSg7oczkQZHYaJ6ASg@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; format=flowed
X-Trace: ger.gmane.org 1359036362 13012 80.91.229.3 (24 Jan 2013 14:06:02 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 24 Jan 2013 14:06:02 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCF5NPH6QMFRBS77QSEAKGQE7UUWE2Y@isocpp.org Thu Jan 24 15:06:22 2013
Return-path: <std-proposals+bncBCF5NPH6QMFRBS77QSEAKGQE7UUWE2Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f199.google.com ([209.85.212.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCF5NPH6QMFRBS77QSEAKGQE7UUWE2Y@isocpp.org>)
	id 1TyNRd-0007K7-7Q
	for gclcip-std-proposals@m.gmane.org; Thu, 24 Jan 2013 15:06:21 +0100
Original-Received: by mail-wi0-f199.google.com with SMTP id hn19sf716784wib.6
        for <gclcip-std-proposals@m.gmane.org>; Thu, 24 Jan 2013 06:06:03 -0800 (PST)
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
         :x-received:message-id:date:from:user-agent:mime-version:to:subject
         :references:in-reply-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;
        bh=Jcbf4tofgcSJVcFtdviXwkYivIDa3qib+rbbDzLgZAc=;
        b=bqXDTQmQMd+YUL+5ow846m6bAEpPHgqlSOAcQRUqzJVPoS9QWBksZoUXS5wPwdOIFp
         yMFXnZRmiQMpjiN/gHRaHlscMmxB11n3gUVPCF1d3NXnfTjhYdK3b6w+9UrsUwh41e+1
         WsY4ppHnHtdss8yvmUdJfIX6zLHSF6Q1Y2vDtqBVEEg3qHzRSZTgytRtOuUDmbm7KZoc
         shMwGtD0JFmS4vj5ur/yS0DxoMOV3ZVgQFGfxoYbHVMuuvsDj59PGFjfz+/ygDaHHBTi
         +oE1fWJiU 
X-Received: by 10.112.24.5 with SMTP id q5mr281175lbf.10.1359036363536;
        Thu, 24 Jan 2013 06:06:03 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.128.164 with SMTP id np4ls32832lab.78.gmail; Thu, 24 Jan
 2013 06:06:03 -0800 (PST)
X-Received: by 10.112.82.136 with SMTP id i8mr839369lby.74.1359036362977;
        Thu, 24 Jan 2013 06:06:02 -0800 (PST)
X-Received: by 10.112.82.136 with SMTP id i8mr839368lby.74.1359036362950;
        Thu, 24 Jan 2013 06:06:02 -0800 (PST)
Original-Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179])
        by mx.google.com with ESMTPS id g9si10648547lbz.260.2013.01.24.06.06.02
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 24 Jan 2013 06:06:02 -0800 (PST)
Received-SPF: neutral (google.com: 209.85.217.179 is neither permitted nor denied by best guess record for domain of chris@bubblescope.net) client-ip=209.85.217.179;
Original-Received: by mail-lb0-f179.google.com with SMTP id j14so2457775lbo.24
        for <std-proposals@isocpp.org>; Thu, 24 Jan 2013 06:06:02 -0800 (PST)
X-Received: by 10.112.84.106 with SMTP id x10mr833683lby.110.1359036362050;
        Thu, 24 Jan 2013 06:06:02 -0800 (PST)
Original-Received: from [138.251.194.250] (dyn-194-250.cs.st-andrews.ac.uk. [138.251.194.250])
        by mx.google.com with ESMTPS id u5sm9728487lbm.8.2013.01.24.06.05.59
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 24 Jan 2013 06:06:00 -0800 (PST)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
In-Reply-To: <CAGsORuB-Qkx-LaXj2jO4yLrwN524kiJONSg7oczkQZHYaJ6ASg@mail.gmail.com>
X-Gm-Message-State: ALoCoQkacWkjLuLWS1EzW/GRSNDd2YVvuu1xfeJJ6Kza1nUnZkoFBg1Ab85MdzaR26cyWa1VJsw9
X-Original-Sender: chris@bubblescope.net
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 209.85.217.179 is neither permitted nor denied by best guess
 record for domain of chris@bubblescope.net) smtp.mail=chris@bubblescope.net
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:2126
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2126>

On 24/01/13 13:52, Zhihao Yuan wrote:
> On Thu, Jan 24, 2013 at 7:38 AM, Ville Voutilainen
> <ville.voutilainen@gmail.com> wrote:
>> I have since cured that problem in my head, there's no 'danger' involved 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 'poison'
>     comparisons between optional<T> and T."
>
> And a carefully specified comparison logic is under discussion.
>
>> boost::optional has such implicit conversions, and I see no reason
>> to do it differently for std::optional.
> This is convincible to some (or many) people, but not me.
> Not all Boost practices are good.  They are not good just because
> they exists for several years.

True. But looking at the boost mailing list and bug reports, there does 
not appear (from what I could find, and remember) to have been any 
complaints about this. We certainly shouldn't ignore implementation 
experience.

I have written quite a lot of code with boost::optional, it is very 
common to make an optional<T> from a T, in 'return' statements for 
example. Having to add an explicit cast to all of those would annoy me.

Chris

-- 

--- 
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.



.
