220 33842 <CAGg_6+MXUEs0Z3mCvEKWXdUQMVsZWxxM1qQpmtXtVJp6P_7K8w@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nevin Liber <nevin@eviloverlord.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: string_view for fstream::open()
Date: Fri, 11 Aug 2017 14:46:40 -0500
Lines: 72
Approved: news@gmane.org
Message-ID: <CAGg_6+MXUEs0Z3mCvEKWXdUQMVsZWxxM1qQpmtXtVJp6P_7K8w@mail.gmail.com>
References: <cb7b55ab-7113-4d99-949b-8568627d0b7f@isocpp.org>
 <CANh-dX=_vJGW1nxKEEjiSJ_=-+hkUab6i5KVSWJYe03ooBmnfA@mail.gmail.com>
 <CAA7U3HM=a7==w_ruj=7XAE-00KC2nDJh5wtodhQgW3v8LuVWEA@mail.gmail.com>
 <3456831.gsseCm4DuK@tjmaciei-mobl1> <6240d6af-a518-4788-a56f-b7d0c8976dc4@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="94eb2c11972ad90aec05567f94b4"
X-Trace: blaine.gmane.org 1502480845 5140 195.159.176.226 (11 Aug 2017 19:47:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 11 Aug 2017 19:47:25 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCE35H5S6IDBBSUTXDGAKGQE4UEO6GA@isocpp.org Fri Aug 11 21:47:20 2017
Return-path: <std-proposals+bncBCE35H5S6IDBBSUTXDGAKGQE4UEO6GA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCE35H5S6IDBBSUTXDGAKGQE4UEO6GA@isocpp.org>)
	id 1dgFtt-0000oW-Cj
	for gclcip-std-proposals@m.gmane.org; Fri, 11 Aug 2017 21:47:17 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id y145sf72121272ywa.9
        for <gclcip-std-proposals@m.gmane.org>; Fri, 11 Aug 2017 12:47:24 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502480843; cv=pass;
        d=google.com; s=arc-20160816;
        b=KXiXRyPT2wxy3o7MdnfZCKTUZQqtRgG4kjKEdbk/FxKEVFhJciFx/ehGM0leTKmoPg
         pg0270mulzXtYBL121wVquaplNsOb/Eya6s5Y3ssXXeMwoShbjfDmAuAI58FOjYxohKF
         580efxnWSkqz2qk//SSg2wwWd3zUKwjVJ/XMvi8eADfyZukWEm1MgIL6ZgDvD7uFGhvf
         5BBR5ordR4aHwLUeHL5LDR3f08ocMFpePkESM5uERCbL343YIntk+OO/spta6UIWLKbx
         K7lLCAQIAZD2kLP8/4ZLenPMl3bL3C3Bk6fZWig7lvcZq4VOTY0DPxwMzLYb79Jrtq7k
         X7xA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:sender:mime-version
         :arc-authentication-results:arc-message-signature
         :arc-authentication-results;
        bh=Zfei+9YbxSyz2VZl2B/S6HioULqwcZI+pR0fjKyOfhw=;
        b=EwWmLZ/Rl4HMUs8UzSzqqzidWY6ASySaSR93ekSc8KYeLKGKbJoQDN+CVIUn/3WH+i
         n0gZnoEZY5kse27JrCm2tmjBu9bMfiqWwt7vQVf2dcKz3pdCsdudzpYpGlCAI1CS5Lsi
         TDwaw9yiXpL5GHgu1E+6Iotla61ExyvEnWI0ZYCtjkIT/NbIcrRn5gRpfBERPRar3+lZ
         HdkM/4X6PpwpDpO0vM3ERrLMGyez7/t9GyqE/PRKQd7Lg4O9+wtd+6umGzsoM1x/P6A/
         bNPD/yRzrKViNy4SV/5drNYpaITyB5Uin5WhUKxeriklHsZLMEetPH9d818m9TicaOfu
         uBRA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lw7ZxGGA;
       spf=pass (google.com: domain of nliber@gmail.com designates 2607:f8b0:400e:c05::236 as permitted sender) smtp.mailfrom=nliber@gmail.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
         :date:message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Zfei+9YbxSyz2VZl2B/S6HioULqwcZI+pR0fjKyOfhw=;
        b=GdrfAFKmAA5vsaxxhvnyMo8EgXj629xuX7LeACvHuPaw2pk4lNND8wLlWxGixQZg1J
         WlCEUWg1WLuRmglQ58Le0WRnsik1++/5A5AaCSa7i3e/Q8Nw/CqFSupcDskH4+/aBmEJ
         j9PO6o/VpzGzKRFbopP9cLrwLWq8D0SuFzZ93iLtEXfZcXlZgzf50GuFW441CVf7Y4uc
         vkmkzpNWTzv/vYhUJpHRwqPqKe9L5ir+1LwlPccpBX+iXBLpahS/SA0Q0MaUQorKDerE
         aZViLrwTjPu1+yqBz6bFmVA7Hk7N8dKDWHhN3RR5HEQ5n8uSZEdSEXM5KMb8jVZl04S8
         MuRg==
X-Gm-Message-State: AHYfb5iYerR6/PGgeJjGcDkvO9bDU+TjQZIgqkN4hYko+fcTPmTHGDyF
	YKW71CUJKVyx3g==
X-Received: by 10.129.46.143 with SMTP id u137mr10406512ywu.224.1502480843491;
        Fri, 11 Aug 2017 12:47:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.29.199 with SMTP id d190ls1701985iod.39.gmail; Fri, 11 Aug
 2017 12:47:22 -0700 (PDT)
X-Received: by 10.84.239.22 with SMTP id w22mr18874226plk.90.1502480842168;
        Fri, 11 Aug 2017 12:47:22 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502480842; cv=none;
        d=google.com; s=arc-20160816;
        b=d20qTHPh85ztqvmAlz1nW+x6CQCqSHAj1WxhiV5Lw16+C3yt0Z06awLvJE0vm+gdqN
         6tOrqrh9MkOYzXr+OrNqjdpNedC4YOidPWiVklIdIgogUEvHHKhZ6Jk9WwBxe/URSzjc
         b3c9q4Vg/xZ0WQTywQ847D2aTae4FtS2tj18k7+FqxkxwWAnZZE8D50FjjWYM+5eDbUf
         MLsGTn6oZ/QQbPCMbO+D+JFFjcLTVPZhW0ttecEyl1bnp06ZffdNtheUnql6vL8cBfFi
         hDk6xlgBXtSFlYCRV3PIkQr5Z34Sv6j3qmRDhmZBz7nC93BFgEhJobFGGAu+1+cQ/Z9I
         98fg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:sender
         :mime-version:dkim-signature:arc-authentication-results;
        bh=2LWThT4YQ6e6W4kjLpg3nyhCCfR/BXx5joeA1Jp9b5k=;
        b=hJHDGDHPSx2J+VR+BV3Jiw1sX5y5aKE2Yk0Npt/AB10jf5R0BheIQPjcB0/B/JyfK2
         vbnneaKobLtpbW9zjZrj0osX9o1jdX1sA9TSS2rvfE8K7KKO3altUFqfW0egREnFRZis
         H0MARe2FlxBmRinf1YHUfq0VdannkcltMzX2u4HFpWDHWergq4yMMijinx0gRBz9NA1/
         xnlunOGoLuni+iAs8IV2HfOVBdflVJ7zwcGMSUROkjA4tIXa1+1sLGC4gqYeBh/EG+1s
         vxGgibLox1i4OFkXu5ZxMbRTvCnZMIEP0lxFLE89a2r/APXVXVPck+JHqFEQgOsbiWOF
         G/gw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lw7ZxGGA;
       spf=pass (google.com: domain of nliber@gmail.com designates 2607:f8b0:400e:c05::236 as permitted sender) smtp.mailfrom=nliber@gmail.com
Original-Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com. [2607:f8b0:400e:c05::236])
        by mx.google.com with ESMTPS id i12si880183pgc.831.2017.08.11.12.47.22
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 11 Aug 2017 12:47:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of nliber@gmail.com designates 2607:f8b0:400e:c05::236 as permitted sender) client-ip=2607:f8b0:400e:c05::236;
Original-Received: by mail-pg0-x236.google.com with SMTP id u5so19297428pgn.0
        for <std-proposals@isocpp.org>; Fri, 11 Aug 2017 12:47:22 -0700 (PDT)
X-Received: by 10.84.129.131 with SMTP id b3mr19591403plb.415.1502480841638;
 Fri, 11 Aug 2017 12:47:21 -0700 (PDT)
Original-Sender: nliber@gmail.com
Original-Received: by 10.100.133.80 with HTTP; Fri, 11 Aug 2017 12:46:40 -0700 (PDT)
In-Reply-To: <6240d6af-a518-4788-a56f-b7d0c8976dc4@isocpp.org>
X-Original-Sender: nevin@eviloverlord.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=Lw7ZxGGA;       spf=pass
 (google.com: domain of nliber@gmail.com designates 2607:f8b0:400e:c05::236 as
 permitted sender) smtp.mailfrom=nliber@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:33842
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33842>

--94eb2c11972ad90aec05567f94b4
Content-Type: text/plain; charset="UTF-8"

On Fri, Aug 11, 2017 at 12:01 PM, Nicol Bolas <jmckesson@gmail.com> wrote:

> `zstring_view` is conceptually a `string_view`. This means that it is a
> pointer+size, so `size()` is always O(1). But this also means that if you
> try to put a literal in a `zstring_view`, it will have to invoke
> `char_traits::length` to get the length. This is good if you're actually
> going to use begin/end iterator pairs. But it's painful if you're just
> doing one-time forward iteration.
>

Is it really that painful in practice?  I would expect a compiler to
optimize the length call away for a zstring_view<char> taking a C-string
literal.

Non-literals where you don't know the size are likely more of a problem, in
that you might be turning a one-pass algorithm into a two-pass algorithm.
-- 
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  +1-847-691-1404

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGg_6%2BMXUEs0Z3mCvEKWXdUQMVsZWxxM1qQpmtXtVJp6P_7K8w%40mail.gmail.com.

--94eb2c11972ad90aec05567f94b4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Fri, Aug 11, 2017 at 12:01 PM, Nicol Bolas <span dir=3D=
"ltr">&lt;<a href=3D"mailto:jmckesson@gmail.com" target=3D"_blank">jmckesso=
n@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>`zstr=
ing_view` is conceptually a `string_view`. This means that it is a pointer+=
size, so `size()` is always O(1). But this also means that if you try to pu=
t a literal in a `zstring_view`, it will have to invoke `char_traits::lengt=
h` to get the length. This is good if you&#39;re actually going to use begi=
n/end iterator pairs. But it&#39;s painful if you&#39;re just doing one-tim=
e forward iteration.<br></div></div></blockquote><div><br></div><div>Is it =
really that painful in practice?=C2=A0 I would expect a compiler to optimiz=
e the length call away for a zstring_view&lt;char&gt; taking a C-string lit=
eral.</div><div><br></div><div>Non-literals where you don&#39;t know the si=
ze are likely more of a problem, in that you might be turning a one-pass al=
gorithm into a two-pass algorithm.</div></div>-- <br><div class=3D"gmail_si=
gnature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=
=3D"ltr"><div>=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D=
"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a=
>&gt; =C2=A0+1-847-691-1404</div></div></div></div></div>
</div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAGg_6%2BMXUEs0Z3mCvEKWXdUQMVsZWxxM1q=
QpmtXtVJp6P_7K8w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGg_6%2BMXUEs0=
Z3mCvEKWXdUQMVsZWxxM1qQpmtXtVJp6P_7K8w%40mail.gmail.com</a>.<br />

--94eb2c11972ad90aec05567f94b4--

.
