220 8728 <CANh-dXk8xb3aWcSr7qG75hjSNAu5hQR0EopiELSTdDLF-OjXuw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Jeffrey Yasskin <jyasskin@google.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: string_view::is_null()
Date: Sun, 19 Jan 2014 22:12:55 -0800
Lines: 29
Approved: news@gmane.org
Message-ID: <CANh-dXk8xb3aWcSr7qG75hjSNAu5hQR0EopiELSTdDLF-OjXuw@mail.gmail.com>
References: <CAGNvRgDH=X2h4K_u3zOu7gUNuQbAcNHGNh=HfCRO9qG1mmiG1w@mail.gmail.com>
 <CANh-dXnytwWwS7E_BGA-xK8E-zw788TJKzM=HJdC-9JbF7+gTQ@mail.gmail.com>
 <104254A6-C69A-4571-8455-89D7E466D493@gmail.com> <CANh-dXngzdnwZZnLRxd=AXQcqLaQky9Cpdw6pkbH8tFqRyZavw@mail.gmail.com>
 <6a95bf9c-55c9-4ae2-966f-d1b1f4df6a37@isocpp.org> <52D9E336.1060801@knejp.de>
 <1B534FD7-B385-4A7E-A718-3C73F0AB61DC@gmail.com> <11f13f8f-1270-427c-8942-94027a181ff4@isocpp.org>
 <20140119174431.GA16875@faust.lysator.liu.se> <CAPOJ94Nt8tinr8hGeR-=rWZS0a529kY38NU-yo6BYM6kVo7czg@mail.gmail.com>
 <20140119192238.GA19497@faust.lysator.liu.se> <60842af6-5ec4-4364-b2d5-a0be9d578bd6@isocpp.org>
 <6c82c4ae-c144-443a-81b2-ea1a6b645601@isocpp.org> <CAGg_6+NYK0pndHN1sUk9=Lzz2gda_c5Yb1R_MXHXEPudwM5TmA@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 1390198390 18036 80.91.229.3 (20 Jan 2014 06:13:10 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 20 Jan 2014 06:13:10 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDDM34EO6QDRB6746KLAKGQEDAIRJKQ@isocpp.org Mon Jan 20 07:13:18 2014
Return-path: <std-proposals+bncBDDM34EO6QDRB6746KLAKGQEDAIRJKQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pb0-f71.google.com ([209.85.160.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDDM34EO6QDRB6746KLAKGQEDAIRJKQ@isocpp.org>)
	id 1W586n-0005pt-7L
	for gclcip-std-proposals@m.gmane.org; Mon, 20 Jan 2014 07:13:17 +0100
Original-Received: by mail-pb0-f71.google.com with SMTP id jt11sf11691579pbb.2
        for <gclcip-std-proposals@m.gmane.org>; Sun, 19 Jan 2014 22:13:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=NukRf+QA4jlZj8O1R5/4oQabVvrSwuKOeGOD0MQEcO8=;
        b=l9NZAC71ZR0XymGPKsPJolp0VJbYdpRei876p+S135WJCgl7kGxc9KdESST3qLHCr/
         OMyaqey2DcwcL8t53iYiLhkT0ZBp9FG4hJ4qALxK/h+IaTnZSDN8sQNrt7ABv2mbYg7T
         H+n2PFtK2c5//VNXDIcYtWcyI53CBvK3Yze7GeJFudpl5apf/GV6x77Gbn1r7R2eiyXD
         CAYrHRU03hjpIzXo+52cv9Ek4x3OVwWKH/wPFCHgIzBpU6CdFjUk/GieujHRNYp6rzRZ
         XSTS0F+BCi7TjZNtv8uXybz2hiq2KMYjflVGH3x6LzUp34t7fTX8goTvxV/1iltonxk4
         V9yg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=NukRf+QA4jlZj8O1R5/4oQabVvrSwuKOeGOD0MQEcO8=;
        b=d/KUiglt5EpVjcpucGyM5LBOQdJ3aJJwWJgBOQHVX4yIgLpOUKtj+PrlrVrVzaJbbB
         f3sJYvs3oKTkEBsZCn2WjMiNlM0744J0V3Nhpdrvl/HeHBGtPiJvy8FVMjmIpAFeg7hT
         m8LDiwp20n7VJYZu0dylUTyUMkiuXBoAPtHFWh/pYbwlZiffPufNUSfJ3sYutTsapjTt
         a+tA35UIvf3hvRu9+uIN6Wx67YmPjJubjgYe0tOAqP2bUixffCbpVMNcONL+EHSpdgQo
         D6aePjCpsMjbH2AaxKQue6qjRbT8pImr0tqDxeQqZBUCsVBbQRAj7a/AgqLLoFCzWMNd
         PHIw==
X-Gm-Message-State: ALoCoQmqSuoRUGDyngcikEMwBaGW4YVnBQk28ip8sIWINa8D0xwlbHLTRSdES+Tem8IPuqE2qVRh
X-Received: by 10.66.6.1 with SMTP id w1mr5877082paw.6.1390198396071;
        Sun, 19 Jan 2014 22:13:16 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.32.228 with SMTP id h91ls935003qgh.14.gmail; Sun, 19 Jan
 2014 22:13:15 -0800 (PST)
X-Received: by 10.224.51.196 with SMTP id e4mr25052171qag.16.1390198395361;
        Sun, 19 Jan 2014 22:13:15 -0800 (PST)
Original-Received: from mail-qe0-x22b.google.com (mail-qe0-x22b.google.com [2607:f8b0:400d:c02::22b])
        by mx.google.com with ESMTPS id q10si6093qaj.14.2014.01.19.22.13.15
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 19 Jan 2014 22:13:15 -0800 (PST)
Received-SPF: pass (google.com: domain of jyasskin@google.com designates 2607:f8b0:400d:c02::22b as permitted sender) client-ip=2607:f8b0:400d:c02::22b;
Original-Received: by mail-qe0-f43.google.com with SMTP id nc12so6047727qeb.16
        for <std-proposals@isocpp.org>; Sun, 19 Jan 2014 22:13:15 -0800 (PST)
X-Received: by 10.224.97.7 with SMTP id j7mr25227035qan.81.1390198395173; Sun,
 19 Jan 2014 22:13:15 -0800 (PST)
Original-Received: by 10.229.226.196 with HTTP; Sun, 19 Jan 2014 22:12:55 -0800 (PST)
In-Reply-To: <CAGg_6+NYK0pndHN1sUk9=Lzz2gda_c5Yb1R_MXHXEPudwM5TmA@mail.gmail.com>
X-Original-Sender: jyasskin@google.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of jyasskin@google.com designates 2607:f8b0:400d:c02::22b as permitted
 sender) smtp.mail=jyasskin@google.com;       dkim=pass header.i=@google.com;
       dmarc=pass (p=REJECT dis=NONE) header.from=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>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8728
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8728>

On Sun, Jan 19, 2014 at 10:01 PM, Nevin Liber <nevin@eviloverlord.com> wrote:
> On 19 January 2014 22:07, Paul Tessier <phernost@gmail.com> wrote:
>>
>> Why would ( nullptr, 3 ) be considered an empty view?
>
>
> It would be undefined behavior.
>
> My personal preference for all this is that string_view(nullptr, 0) be
> allowed, and it is a Quality of Implementation issue whether or not
> sv.data() can ever return a nullptr; i.e., it would be allowed to return any
> legal pointer it wants for an empty string_view.

That's interesting. It's easier to both specify and implement to just
say that string_view(x, y).data()==x and string_view(x, y).size()==y,
assuming [x, x+y) is a valid range. Why would you special-case data()
to return arbitrary things when y==0?

Thanks,
Jeffrey (who's adding the data()==nullptr option to the paper as we speak)

-- 

--- 
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/.

.
