220 33687 <9f6c436a-852c-4665-bf9f-91415491cdec@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: galaxy.wars@gmx.at
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: string_view for fstream::open()
Date: Tue, 8 Aug 2017 10:59:44 -0700 (PDT)
Lines: 77
Approved: news@gmane.org
Message-ID: <9f6c436a-852c-4665-bf9f-91415491cdec@isocpp.org>
References: <cb7b55ab-7113-4d99-949b-8568627d0b7f@isocpp.org>
 <omctnb$6nf$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2684_1761852047.1502215184920"
X-Trace: blaine.gmane.org 1502215184 1186 195.159.176.226 (8 Aug 2017 17:59:44 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 8 Aug 2017 17:59:44 +0000 (UTC)
Cc: bop@gmb.dk
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDC4D254TYORBEPYU7GAKGQEBFG4OGA@isocpp.org Tue Aug 08 19:59:40 2017
Return-path: <std-proposals+bncBDC4D254TYORBEPYU7GAKGQEBFG4OGA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f199.google.com ([209.85.216.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDC4D254TYORBEPYU7GAKGQEBFG4OGA@isocpp.org>)
	id 1df8n6-0008VK-H0
	for gclcip-std-proposals@m.gmane.org; Tue, 08 Aug 2017 19:59:40 +0200
Original-Received: by mail-qt0-f199.google.com with SMTP id d15sf18774348qta.11
        for <gclcip-std-proposals@m.gmane.org>; Tue, 08 Aug 2017 10:59:47 -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=KIDbezvvJB3siVlOR9BuidjWcQNM7peagA2repNFQj8=;
        b=NYUnJVhsZYh8SJlHWZGKjaiTz8VMFrJfVDagGZGDsFGaX7RX1vbXjT83V3TyWAIhpb
         CuuIHbgWqtjxtIhbcA3UBj8uLMZXZExiQgzk40N73RnWOAejvQO1bkSMbsguYMOfJY3u
         e9wu7skOoQ46NmbS1FatHEWFfW09IG+ZoX14ueh7stJn9yZR/TZQQUvyNTcJMdXc0Z8w
         sE8C6m/Ah79nsLuumuP7VkRmwNn5VwCTBxFPrYEPPr7LAZuuqwCHudy30OTmEsDQnzy5
         0IaTLuvtlL3RYzHy4YD0xffZJR0vgEHG7pApF/HPlKQv9az/alU4/z489/IYPtIlwEym
         UmKA==
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=KIDbezvvJB3siVlOR9BuidjWcQNM7peagA2repNFQj8=;
        b=suerhOzoGKcNwbr3BaKcCWXY0RO5cXW4eNPckeyjScSUH3XB2hXwnbjaPUz/pg1eha
         MznodQXBuMvHmP7ip5olscrK2Hq/OR3rfCPcePh5kBd14k7SN84JStcgzqjns0X/tRMW
         K3o+M0J9OJuUzp9QhDLkadKGIhKakhSECdrvVaBa8w6t2jXY3SWys57KanjDfJnWogj9
         qR3QN9vtVzpUYRJ5iffL/29yZcn1alvydaPAwwnyUwIsAKmdxkDdcNi44TS3Et75tTCZ
         isPDIQ/+4Gi72pRVxmXjeargMB7W/FK71uh7x/5W0ZZ628jYikszDS8YvUqZXxNzzYh7
         N3pQ==
X-Gm-Message-State: AHYfb5g2GKLJf7XvpKt7ss2xssc4VWvtVZEuvgfGde+6Xzaxs0Mga4BO
	754vDefdLQJ9VPQq
X-Received: by 10.200.53.215 with SMTP id l23mr3213352qtb.33.1502215186738;
        Tue, 08 Aug 2017 10:59:46 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.172.109 with SMTP id m45ls4258319iti.11.canary-gmail; Tue,
 08 Aug 2017 10:59:45 -0700 (PDT)
X-Received: by 10.31.157.209 with SMTP id g200mr27925vke.9.1502215185332;
        Tue, 08 Aug 2017 10:59:45 -0700 (PDT)
In-Reply-To: <omctnb$6nf$1@blaine.gmane.org>
X-Original-Sender: galaxy.wars@gmx.at
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:33687
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33687>

------=_Part_2684_1761852047.1502215184920
Content-Type: multipart/alternative; 
	boundary="----=_Part_2685_380692044.1502215184920"

------=_Part_2685_380692044.1502215184920
Content-Type: text/plain; charset="UTF-8"

Am Dienstag, 8. August 2017 19:52:02 UTC+2 schrieb Bo Persson:
 

> One objection is that the file name is supposed to be a nul-terminated 
> string. The string_view is not required to be that. 
>
>
>      Bo Persson 
>
>
>
I realize that this is the current state, which is why I said that I'd have 
to create a temporary std::string from a std::string_view if I want to open 
a file-stream safely; otherwise I could just call the "const char* 
filename" overload from std::string_view::data().

Is there any technical reason why the filename would have to be 
nul-terminated? Otherwise one could simply make an implementation for 
open() that does not require a nul-terminated string but rather a (const 
char* filename, size_t size) pair. 

-- 
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/9f6c436a-852c-4665-bf9f-91415491cdec%40isocpp.org.

------=_Part_2685_380692044.1502215184920
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Am Dienstag, 8. August 2017 19:52:02 UTC+2 schrieb Bo Pers=
son:<br><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:=
 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">One o=
bjection is that the file name is supposed to be a nul-terminated=20
<br>string. The string_view is not required to be that.
<br>
<br>
<br>=C2=A0 =C2=A0 =C2=A0Bo Persson
<br>
<br>
<br></blockquote><div><br>I realize that this is the current state, which i=
s why I said that I&#39;d have to create a temporary std::string from a std=
::string_view if I want to open a file-stream safely; otherwise I could jus=
t call the &quot;const char* filename&quot; overload from std::string_view:=
:data().<br><br>Is there any technical reason why the filename would have t=
o be nul-terminated? Otherwise one could simply make an implementation for =
open() that does not require a nul-terminated string but rather a (const ch=
ar* filename, size_t size) pair. <br></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/9f6c436a-852c-4665-bf9f-91415491cdec%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9f6c436a-852c-4665-bf9f-91415491cdec=
%40isocpp.org</a>.<br />

------=_Part_2685_380692044.1502215184920--

------=_Part_2684_1761852047.1502215184920--

.
