220 8280 <5f119e75-8d40-4cb1-b25d-778b1bbc88a5@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Peter Bigot <bigotp@acm.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: string_view::is_null()
Date: Sat, 28 Dec 2013 11:27:52 -0800 (PST)
Lines: 110
Approved: news@gmane.org
Message-ID: <5f119e75-8d40-4cb1-b25d-778b1bbc88a5@isocpp.org>
References: <8045a4d2-721d-4725-8bb7-7a91b6f53ec8@isocpp.org>
 <186E0927-C962-4E34-AED0-E7509DD1F0A0@gmail.com>
 <ddfcc8e4-aee1-44b5-beca-5401ab86e8a9@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1283_28188992.1388258872556"
X-Trace: ger.gmane.org 1388258867 2955 80.91.229.3 (28 Dec 2013 19:27:47 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 28 Dec 2013 19:27:47 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDA3LUEAQACBBOOM7SKQKGQEONCPTQQ@isocpp.org Sat Dec 28 20:27:55 2013
Return-path: <std-proposals+bncBDA3LUEAQACBBOOM7SKQKGQEONCPTQQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDA3LUEAQACBBOOM7SKQKGQEONCPTQQ@isocpp.org>)
	id 1VwzYA-0001mm-Im
	for gclcip-std-proposals@m.gmane.org; Sat, 28 Dec 2013 20:27:54 +0100
Original-Received: by mail-ie0-f199.google.com with SMTP id lx4sf48506546iec.10
        for <gclcip-std-proposals@m.gmane.org>; Sat, 28 Dec 2013 11:27:53 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=XEIsjvpsLqHKBMUb/KQnkZmwkMA5Fx9ijhrBvhLD3kY=;
        b=iBKzSjh5DcijskrlFhmST6ovLXdf+VTNf3ns4ST6r5jzp/kwYox5T1N4K5voMcF+rI
         NLgYYuOQ695v56ExbfBEIt1+ghYiR7gicI5VsK7ycF7K3/L63sIMMwD/SNRa5+U7Uuob
         /LJBULzjZSk2BIFBpYsSKR97swjWA7IV8CuT9fIsJLalyvQOopSQlU7rWXQEGptQm057
         DlORM7oR+Ngq168VddHdl8569YAQby2T2KdYnlm1nAX4rCtCPUBehHcwCLFcY2EwHYUD
         1Fw4NtnN/jbDvYazM6ilYZ1rqniRTVO9KvZ9yYvmo+ZHrTj5Eh+jd/uw4tAP1cWH86l3
         O9yw==
X-Gm-Message-State: ALoCoQkOPKzkOpx9Kp9j5Hly4jPs2aIrCqGdcBNUGR0Y04hs9IFJWT7iMg24l2503Jo5eIk8ojKd
X-Received: by 10.43.74.133 with SMTP id yw5mr18570866icb.15.1388258873685;
        Sat, 28 Dec 2013 11:27:53 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.191.103 with SMTP id gx7ls1321384obc.25.gmail; Sat, 28 Dec
 2013 11:27:53 -0800 (PST)
X-Received: by 10.182.96.135 with SMTP id ds7mr476376obb.1.1388258873006;
        Sat, 28 Dec 2013 11:27:53 -0800 (PST)
In-Reply-To: <ddfcc8e4-aee1-44b5-beca-5401ab86e8a9@isocpp.org>
X-Original-Sender: bigotp@acm.org
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:8280
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8280>

------=_Part_1283_28188992.1388258872556
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable



On Saturday, December 28, 2013 1:21:12 PM UTC-6, Peter Bigot wrote:
>
>
> On Friday, December 27, 2013 11:01:34 PM UTC-6, Marshall wrote:
>>
>>
>> if sv.size () =3D=3D 0 or sv.empty () [same thing], there is nothing tha=
t you=20
>> can do with sv.data()
>> (except compare it to null, and that doesn=92t tell you anything useful)=
..
>>
>
> My understanding (which I'd like confirmed) is that sv.data() is still=20
> useful as it provides a valid position within the referenced object, whic=
h=20
> might be referenced by other string_view instances or in its native form.
>
> Thus, for example, a function object conforming to the delimiters=20
> interface documented at=20
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3593.html#delimi=
tersmight return a zero-length string to denote a zero-length delimiter (e.=
g.,=20
> the position following a period in an English sentence).  In this case it=
=20
> is the value of sv.data() that tells the caller where the delimited=20
> sequence ends and the next sequence begins.
>
>
Sorry; I misread the details of that proposal: it explicitly uses an empty=
=20
delimiter to indicate "not found" (too bad; zero-length delimiters would be=
=20
useful).  It does, though, specify "not found" as an empty string_view=20
where sv.data() is the end of the referenced string, which avoids the need=
=20
to special-case the end of the last token.

Peter

--=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/.

------=_Part_1283_28188992.1388258872556
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Saturday, December 28, 2013 1:21:12 PM UTC-6, P=
eter Bigot wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><br>On Friday, December 27, 2013 11:01:34 PM UTC-6, Marshall wrote:<blo=
ckquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"><br=
><div>if sv.size () =3D=3D 0 or sv.empty () [same thing], there is nothing =
that you can do with sv.data()</div><div>(except compare it to null, and th=
at doesn=92t tell you anything useful).</div></div></blockquote><div><br>My=
 understanding (which I'd like confirmed) is that sv.data() is still useful=
 as it provides a valid position within the referenced object, which might =
be referenced by other string_view instances or in its native form.<br><br>=
Thus, for example, a function object conforming to the delimiters interface=
 documented at <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/paper=
s/2013/n3593.html#delimiters" target=3D"_blank" onmousedown=3D"this.href=3D=
'http://www.google.com/url?q\75http%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%=
2Fwg21%2Fdocs%2Fpapers%2F2013%2Fn3593.html%23delimiters\46sa\75D\46sntz\075=
1\46usg\75AFQjCNGCC2kdT2gdNH-KLrrmzVuupb4nqQ';return true;" onclick=3D"this=
..href=3D'http://www.google.com/url?q\75http%3A%2F%2Fwww.open-std.org%2Fjtc1=
%2Fsc22%2Fwg21%2Fdocs%2Fpapers%2F2013%2Fn3593.html%23delimiters\46sa\75D\46=
sntz\0751\46usg\75AFQjCNGCC2kdT2gdNH-KLrrmzVuupb4nqQ';return true;">http://=
www.open-std.org/jtc1/<wbr>sc22/wg21/docs/papers/2013/<wbr>n3593.html#delim=
iters</a> might return a zero-length string to denote a zero-length delimit=
er (e.g., the position following a period in an English sentence).&nbsp; In=
 this case it is the value of sv.data() that tells the caller where the del=
imited sequence ends and the next sequence begins.<br><br></div></div></blo=
ckquote><div><br>Sorry; I misread the details of that proposal: it explicit=
ly uses an empty delimiter to indicate "not found" (too bad; zero-length de=
limiters would be useful).&nbsp; It does, though, specify "not found" as an=
 empty string_view where sv.data() is the end of the referenced string, whi=
ch avoids the need to special-case the end of the last token.</div><br>Pete=
r<br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1283_28188992.1388258872556--

.
