220 22099 <78099cf0-3d5a-4531-99e4-03ea92e83455@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: string view constructed from iterator pair?
Date: Thu, 29 Oct 2015 09:54:29 -0700 (PDT)
Lines: 78
Approved: news@gmane.org
Message-ID: <78099cf0-3d5a-4531-99e4-03ea92e83455@isocpp.org>
References: <476bb7a8-15ec-4f9c-a295-592495de3a86@isocpp.org>
 <CANh-dX=dC4HrWVNX9wgs1BB0J8MXUNJwExpL8x0x7ueZswHzuw@mail.gmail.com>
 <CADbh+eQ9yUyfrfJAVYp6R2fPDoCYCjor9xWpS0H4atc9W-95fQ@mail.gmail.com>
 <0fdef179-8304-40fb-bc94-48d908e779d0@isocpp.org>
 <5ee68d17-bb78-4bb7-8ff4-994f1016a0ad@isocpp.org>
 <CADbh+eTyxSzwfsAKpMQCathj1Nc8C1Jse=XAQXgG8BiyivjJ_Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_653_1669803613.1446137669604"
X-Trace: ger.gmane.org 1446137674 11958 80.91.229.3 (29 Oct 2015 16:54:34 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 29 Oct 2015 16:54:34 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBRU6ZGYQKGQEZFBAWEY@isocpp.org Thu Oct 29 17:54:34 2015
Return-path: <std-proposals+bncBCEKFTV6ZUMBBRU6ZGYQKGQEZFBAWEY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f71.google.com ([209.85.220.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBRU6ZGYQKGQEZFBAWEY@isocpp.org>)
	id 1ZrqTA-0005yi-5X
	for gclcip-std-proposals@m.gmane.org; Thu, 29 Oct 2015 17:54:32 +0100
Original-Received: by padda3 with SMTP id da3sf37110187pad.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 29 Oct 2015 09:54:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type: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=FwQgvC80I0+SBxLeBaP8QVfazl6gEFwjOMi5z+gMvq8=;
        b=UgyXiJcgB/N9h8NpQxjMq3mENchHd6UdI2sr8oazRLVB0v4hxxGQQUwQ0/nykg/yQ7
         DKSQjQPjqutX5VY+j39VXgKOHVMh9VmhtYIx5AXZirotaODgicYE0l9TsonTUzEDCH4d
         GzP+YvX1nS1wgU7d/+rjn1nzf4Qnb77FkHwnxpsceq2MpoJIK1x5VGsnpgostwAQ2hId
         FBOpnpTqM2iJT0DRzH4M388Q2Kv3Zlak2Qsr9zcT2EFJ9jME4O0XbBDcWQIP83xT85LP
         vowQuDgavY6FOUvOFz+K1OHiQyBaTghdJ0Sk+HtvEDzZM+9ayxztiVlfmgt/XsCjCcD9
         ay0Q==
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:content-type: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=FwQgvC80I0+SBxLeBaP8QVfazl6gEFwjOMi5z+gMvq8=;
        b=TJbaoorEVwzzjGCyk/1z4AwzyCjFFcD7Lic3rUrCZu7Trgcg36PrpXwzooZoPqkEid
         aqpIDc1TWJU+B6y34Sgr324Y2GpqvjJojZ+jWoQCIu7dP0IZOBTxa39p+9HdTmlPI3cM
         P+2ubZ9Agk9gOkflRWSXJWbBBjopBVWf7S96fSgYnGMfFd4i2h7uOreR+OAauedW398u
         IpTQjiMelEsjRUPFPkFiSCYoXI5m4Jh0ZIfNFMdzZYwlkHWMzr3GO2sM4rgOAMYohVJY
         YSsSlyJoo+VByv4U5LXL+aKrJIY0nqpfKhTvK2q+fDk4L/h0vhS7JQOuC6eEUMfAqtOQ
         2zGw==
X-Gm-Message-State: ALoCoQnrMVEew9BzsYFpb2F0eIMQMTPAso6PFXMkR1a97UFX/67FTPQpz6a4ZmL0c/I7hrmaLwHA
X-Received: by 10.66.165.7 with SMTP id yu7mr2125202pab.45.1446137671226;
        Thu, 29 Oct 2015 09:54:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.27.83 with SMTP id b80ls347134iob.20.gmail; Thu, 29 Oct
 2015 09:54:30 -0700 (PDT)
X-Received: by 10.50.30.5 with SMTP id o5mr114569igh.10.1446137670400;
        Thu, 29 Oct 2015 09:54:30 -0700 (PDT)
In-Reply-To: <CADbh+eTyxSzwfsAKpMQCathj1Nc8C1Jse=XAQXgG8BiyivjJ_Q@mail.gmail.com>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:22099
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/22099>

------=_Part_653_1669803613.1446137669604
Content-Type: multipart/alternative; 
	boundary="----=_Part_654_1193284616.1446137669605"

------=_Part_654_1193284616.1446137669605
Content-Type: text/plain; charset=UTF-8

On Thursday, October 29, 2015 at 12:24:33 PM UTC-4, Brent Friedman wrote:
>
> Evan,
>
> Yes that does address the issue I was raising. Of course, if strings and 
> vectors used pointer iterators then we wouldn't need the if test or the 
> overload at all.
>

Even if those two types use pointer iterators, that shouldn't mean that 
contiguous iterators *ought* to be pointers. What about range adaptors? 
Some of those can be contiguous iterators, but they're certainly not 
pointers.

Of course, you wouldn't be able to use range adaptors in string_views 
either. They're more for template code. So there's another strike against 
this overload. `string_view` is meant for arrays of characters, which in 
C++ is specified by pointers.

Ultimately, what you want isn't for std::string and std::vector iterators 
to be pointers. You want them to be *convertible* to pointers (and 
vice-versa).

-- 

--- 
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/.

------=_Part_654_1193284616.1446137669605
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, October 29, 2015 at 12:24:33 PM UTC-4, Brent =
Friedman wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr=
">Evan,<div><br></div><div>Yes that does address the issue I was raising. O=
f course, if strings and vectors used pointer iterators then we wouldn&#39;=
t need the if test or the overload at all.</div></div></blockquote><div><br=
>Even if those two types use pointer iterators, that shouldn&#39;t mean tha=
t contiguous iterators <i>ought</i> to be pointers. What about range adapto=
rs? Some of those can be contiguous iterators, but they&#39;re certainly no=
t pointers.<br><br>Of course, you wouldn&#39;t be able to use range adaptor=
s in string_views either. They&#39;re more for template code. So there&#39;=
s another strike against this overload. `string_view` is meant for arrays o=
f characters, which in C++ is specified by pointers.<br><br>Ultimately, wha=
t you want isn&#39;t for std::string and std::vector iterators to be pointe=
rs. You want them to be <i>convertible</i> to pointers (and vice-versa).</d=
iv></div>

<p></p>

-- <br />
<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 <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 />
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_654_1193284616.1446137669605--
------=_Part_653_1669803613.1446137669604--

.
