220 33706 <8bff939d-098b-4797-85fc-bf286ab4423f@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: olafvdspek@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: string_view for fstream::open()
Date: Wed, 9 Aug 2017 02:35:12 -0700 (PDT)
Lines: 105
Approved: news@gmane.org
Message-ID: <8bff939d-098b-4797-85fc-bf286ab4423f@isocpp.org>
References: <cb7b55ab-7113-4d99-949b-8568627d0b7f@isocpp.org>
 <omctnb$6nf$1@blaine.gmane.org>
 <9f6c436a-852c-4665-bf9f-91415491cdec@isocpp.org>
 <b27512b1-0234-45d7-867e-220f2625f13f@isocpp.org>
 <9fedbad3-c6f6-4dbe-a215-814666c52c6b@isocpp.org>
 <a5d35071-ebd9-4c12-94a0-71d991047a8d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_5202_848359589.1502271312100"
X-Trace: blaine.gmane.org 1502271313 17883 195.159.176.226 (9 Aug 2017 09:35:13 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 9 Aug 2017 09:35:13 +0000 (UTC)
Cc: bop@gmb.dk
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5NB45SSABBBUFOVPGAKGQEAT6FB7Y@isocpp.org Wed Aug 09 11:35:08 2017
Return-path: <std-proposals+bncBC5NB45SSABBBUFOVPGAKGQEAT6FB7Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f197.google.com ([209.85.223.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5NB45SSABBBUFOVPGAKGQEAT6FB7Y@isocpp.org>)
	id 1dfNOO-0004PW-4b
	for gclcip-std-proposals@m.gmane.org; Wed, 09 Aug 2017 11:35:08 +0200
Original-Received: by mail-io0-f197.google.com with SMTP id j32sf47868771iod.15
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Aug 2017 02:35:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc: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;
        bh=aUcWYIPATMhRyKpWpCIcM8A63ptYNEkw2LxKmGXPBvA=;
        b=ouCD8/3e7KNTL5vCsL9dIj2FJu9Bz6U/vcUnCpdbs4jKOdoRzM97/Vs+fsY//4zpmt
         bs4UHsglvcMafXHzQICZnTl+21MBFj8iw3t0APhcCj89/nIgUWeTAHFM6WVI8CmouSFr
         JUqvYfbIdC5TZ1b+xcpbhB5FFdhDY2EqmEJLhzbMre7xEfLAnBcwEP0Y7UfqkB4IinLY
         v3OpXh4/CvDagIs5Aa7e0mjO6pUs3YSTX4O0djJIhF2r+au7MBarhg0lP03OwbpBqCW7
         CVUE+O+VAVogtveJDeefyM5cVEE8nmT+5kCBT7TtF0060a2VT5kcj0GnFt8ZqErwAe1N
         lIdQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc: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;
        bh=aUcWYIPATMhRyKpWpCIcM8A63ptYNEkw2LxKmGXPBvA=;
        b=F/wsH3wN+dvvO7a9CbOnmqzZf7mIN04HeqrWZyr3NUJLR8LAZ+Eq4DGDfSLDxCl6ap
         BMaFC0fUd+gatU2D9crsZcdic7oGotPzWizLeoRTV2QoyFMxwE30JHb5ga1Fr79Cvhsp
         qR34m5nrOton1fV9R9Ni4BbumVDGY0fqcM6IJfQRn3xEzIDMnvzN8u6pllCHqsSY0LiV
         qZfqnKdO43x6gDW86WzE57S70sWUiYnZTK6zPbYAV/ikKGuW4lF/R3ADrPGvAY/Fx4YY
         +zOuXr7ANDv1836UKx83r1hSrOuHa9Sxq9/x39wHZwfsFNmqR7MuctoZ86InIpzjygSH
         b8Aw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=aUcWYIPATMhRyKpWpCIcM8A63ptYNEkw2LxKmGXPBvA=;
        b=nYrV6QzQz/bBy6IU3unTGXhouiOQFCD5kR6pjZkwnib2yvS/fcRVE9+ztxq66o14+r
         BudH9yvvGhR/DLVfYr8Bx9/xPDiMAr4K/2Mnycnn8RNP4wX2nur5R/74ypCnxk76urrP
         1tjH+fudW1UETzP+YPeC4rMPIZGMIqrTCxmraXFS5lAJWBh9utw/X0RYwcHYjEYz25Aj
         hNFSNbaAIWtPiG1lK4/xJO5A5GUQEoaXNYxFk7GdvvjP4xsIFlxIBanIN/wBSgILDrcH
         2mUyu616xVfLbkat1JL1IhevhVegNTM87a/0+AfX/2b56lJapRGBN8BpaKTSA/l4pED6
         C6kg==
X-Gm-Message-State: AIVw113FdG3oXDVapOEpJRdW5pLPF4ikVFoMbO/lRJL5RN+xB0MhSE9x
	vZC+Ctvgn3HeAF9R
X-Received: by 10.107.32.11 with SMTP id g11mr4288390iog.76.1502271314032;
        Wed, 09 Aug 2017 02:35:14 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.25.69 with SMTP id b66ls5099875itb.19.canary-gmail; Wed, 09
 Aug 2017 02:35:12 -0700 (PDT)
X-Received: by 10.31.5.203 with SMTP id 194mr45319vkf.29.1502271312707;
        Wed, 09 Aug 2017 02:35:12 -0700 (PDT)
In-Reply-To: <a5d35071-ebd9-4c12-94a0-71d991047a8d@isocpp.org>
X-Original-Sender: olafvdspek@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:33706
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33706>

------=_Part_5202_848359589.1502271312100
Content-Type: multipart/alternative; 
	boundary="----=_Part_5203_1411174733.1502271312100"

------=_Part_5203_1411174733.1502271312100
Content-Type: text/plain; charset="UTF-8"



Op dinsdag 8 augustus 2017 20:54:53 UTC+2 schreef Nicol Bolas:
>
> On Tuesday, August 8, 2017 at 2:16:24 PM UTC-4, Julian Watzinger wrote:
>>
>> Ah, I see. I definately agree on the notion that in this case, its better 
>> that I create a copy myself. 
>>
>> Is there any chance that low-level APIs will be moving away from 
>> nul-terminated strings in the future?
>>
>
> I rather doubt it. It's hardly high on most people's priority lists.
>
> Having a lot of low-level functions require a nul-terminated string kind 
>> of dampends the overall usefulness of string_view IMHO.
>>
>
> Which is why I wrote my own `zstring_view` class, which explicitly 
> represents a view of a NUL-terminated string (it treats the NUL-terminator 
> the same way `std::string` does; you can look at it, but it's not 
> explicitly part of the `begin/end` range). It has some of the operations of 
> `string_view` (thanks to inheritance), but it removes or alters the ones 
> that subdivide from the end. For obvious reasons.
>
> At least from what I can tell after a few days worth of porting to 
>> string_view - at first I though it would be a direct replacement for most 
>> places where "const std::string&" was being used, but now it seems there's 
>> a lot more consideration to be done, not to end up with more 
>> temporaries/allocations than before.
>>
>
> You have exactly expressed why I wrote `zstring_view`.
>

Any plans to propose it for standardization? 

-- 
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/8bff939d-098b-4797-85fc-bf286ab4423f%40isocpp.org.

------=_Part_5203_1411174733.1502271312100
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>Op dinsdag 8 augustus 2017 20:54:53 UTC+2 schreef =
Nicol Bolas:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">O=
n Tuesday, August 8, 2017 at 2:16:24 PM UTC-4, Julian Watzinger wrote:<bloc=
kquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Ah, I see. I definately=
 agree on the notion that in this case, its better that I create a copy mys=
elf. <br><br>Is there any chance that low-level APIs will be moving away fr=
om nul-terminated strings in the future?</div></blockquote><div><br>I rathe=
r doubt it. It&#39;s hardly high on most people&#39;s priority lists.<br><b=
r></div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Having a l=
ot of low-level functions require a nul-terminated string kind of dampends =
the overall usefulness of string_view IMHO.<br></div></blockquote><div><br>=
Which is why I wrote my own `zstring_view` class, which explicitly represen=
ts a view of a NUL-terminated string (it treats the NUL-terminator the same=
 way `std::string` does; you can look at it, but it&#39;s not explicitly pa=
rt of the `begin/end` range). It has some of the operations of `string_view=
` (thanks to inheritance), but it removes or alters the ones that subdivide=
 from the end. For obvious reasons.<br><br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr">At least from what I can tell after a few da=
ys worth of porting to string_view - at first I though it would be a direct=
 replacement for most places where &quot;const std::string&amp;&quot; was b=
eing used, but now it seems there&#39;s a lot more consideration to be done=
, not to end up with more temporaries/allocations than before.<br></div></b=
lockquote><div><br>You have exactly expressed why I wrote `zstring_view`.</=
div></div></blockquote><div><br></div><div>Any plans to propose it for stan=
dardization?=C2=A0</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/8bff939d-098b-4797-85fc-bf286ab4423f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8bff939d-098b-4797-85fc-bf286ab4423f=
%40isocpp.org</a>.<br />

------=_Part_5203_1411174733.1502271312100--

------=_Part_5202_848359589.1502271312100--

.
