220 2365 <CAHOE3yfknuLGWzoN-A1Ugb1VTQB+T9MCn3LS67_en0ZNXd+44w@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Daniel James <dnljms@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: optional<T>, one more value or two states
Date: Sun, 27 Jan 2013 21:27:34 +0000
Lines: 41
Approved: news@gmane.org
Message-ID: <CAHOE3yfknuLGWzoN-A1Ugb1VTQB+T9MCn3LS67_en0ZNXd+44w@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>
	<123b9f65-12fd-4285-bb6c-cfee383d4552@isocpp.org>
	<CAHOE3yeF6KBBz7a1uw58oA3Shh_w0HFGiLtUGEd4ntJAKBauew@mail.gmail.com>
	<CAFk2RUZXrc5MoLdR8ie_kJqwLS1byqpv96qNX4XeEKNnXPu9hQ@mail.gmail.com>
	<CAHOE3ydsbjeP9OJhiC-5BYOnxoqUV3PUF2n6Mkf-VTN9_hJDKg@mail.gmail.com>
	<CAFk2RUa+T=SF31OVA5PJgzf70c8yox5ZT-S8+uuJdY6amrOtjg@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 1359322054 30621 80.91.229.3 (27 Jan 2013 21:27:34 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 27 Jan 2013 21:27:34 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCGPB3VVUAGBBR5XS2EAKGQE3HE6YSQ@isocpp.org Sun Jan 27 22:27:53 2013
Return-path: <std-proposals+bncBCGPB3VVUAGBBR5XS2EAKGQE3HE6YSQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f72.google.com ([74.125.82.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCGPB3VVUAGBBR5XS2EAKGQE3HE6YSQ@isocpp.org>)
	id 1TzZlZ-0005d5-75
	for gclcip-std-proposals@m.gmane.org; Sun, 27 Jan 2013 22:27:53 +0100
Original-Received: by mail-wg0-f72.google.com with SMTP id fg15sf2172871wgb.7
        for <gclcip-std-proposals@m.gmane.org>; Sun, 27 Jan 2013 13:27:35 -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=exAxUyzvxswIcVFGlMC4eaILeDijhXrsWT6mrOFjK6I=;
        b=KOBO6WeuzjLbKXV6/SpEAYqb58bv1hKlGwNU8ZsaCJlDIgnd/K4VC7uBUBDSrS/rfQ
         yG1v/DYTG7cFG5p4UwCt1UyR5Xra8+Xa8EnRn+o2VArYckgeuAP5/d+0aqfeXn0sTPV+
         A3K4PUm80bfOp89qILxt86CKt7PeKMGh11BG48kgti1J/eKqRfK72PqmTNCqq6dqL0lH
         cyJtV0v5t6xyJRGWyKb9kBZsvciWrzCqThMgLa/DzDPNeNKPSY6qeuxKE7TD+5LMPY4S
         m3V3bUa1YzyVBUlPTrE+9cEVonDN9LcZ5iOga9lWM0FK7kobG 
X-Received: by 10.180.105.39 with SMTP id gj7mr37244wib.0.1359322055377;
        Sun, 27 Jan 2013 13:27:35 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.90.200 with SMTP id by8ls783613wib.6.gmail; Sun, 27 Jan
 2013 13:27:34 -0800 (PST)
X-Received: by 10.180.109.195 with SMTP id hu3mr6355077wib.31.1359322054728;
        Sun, 27 Jan 2013 13:27:34 -0800 (PST)
X-Received: by 10.180.109.195 with SMTP id hu3mr6355076wib.31.1359322054703;
        Sun, 27 Jan 2013 13:27:34 -0800 (PST)
Original-Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178])
        by mx.google.com with ESMTPS id e1si2740682wjb.14.2013.01.27.13.27.34
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 27 Jan 2013 13:27:34 -0800 (PST)
Received-SPF: pass (google.com: domain of dnljms@gmail.com designates 209.85.212.178 as permitted sender) client-ip=209.85.212.178;
Original-Received: by mail-wi0-f178.google.com with SMTP id hn3so920986wib.17
        for <std-proposals@isocpp.org>; Sun, 27 Jan 2013 13:27:34 -0800 (PST)
X-Received: by 10.180.109.10 with SMTP id ho10mr6492827wib.9.1359322054621;
 Sun, 27 Jan 2013 13:27:34 -0800 (PST)
Original-Received: by 10.194.46.7 with HTTP; Sun, 27 Jan 2013 13:27:34 -0800 (PST)
In-Reply-To: <CAFk2RUa+T=SF31OVA5PJgzf70c8yox5ZT-S8+uuJdY6amrOtjg@mail.gmail.com>
X-Original-Sender: dnljms@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of dnljms@gmail.com designates 209.85.212.178 as permitted sender)
 smtp.mail=dnljms@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:2365
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/2365>

On 27 January 2013 20:55, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> Yes? x and y point to different things also if y is of the proposed
> value_ptr type.

Don't you think it's odd that value_ptr doesn't behave like a pointer?
That's because it isn't a pointer, it's a fixed size container (like
array). Calling it 'value_ptr' is like referring to 'std::vector' as
'value_ptr_with_length' - it's the implementation not the interface.

> They point to different things if y is an auto_ptr.

I'd forgotten about auto_ptr, but since it is deprecated, it's largely
irrelevant. I think everyone agrees that auto_ptr is not an example of
good design. IMO it actually supports my principle. The problem with
auto_ptr is that it doesn't follow the expected semantics.

> So there are
> already exceptions
> to this alleged rule, and chances are there's more exceptions coming.

IMO there shouldn't be. Thanks to templates, C++ has an odd mix of
structural and nominal typing. So when you have a type structure the
implies a certain behaviour, it means something. I don't think saving
a few characters is a good reason to break that. Anyone who does think
that it is should at least acknowledge that there is a trade off here.

Some people have referred to optional as a "nullable proxy". But it
isn't a proxy, it's a container (in the sense that it contains things,
not in the sense of the C++ definition - although it should be, for
things like flatMap).

-- 

--- 
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.



.
