220 24899 <73454c65-98c8-4327-a0f4-858652f5009e@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: martin.tillmann@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Range erase for std::vector and other containers.
Date: Thu, 3 Mar 2016 07:10:36 -0800 (PST)
Lines: 76
Approved: news@gmane.org
Message-ID: <73454c65-98c8-4327-a0f4-858652f5009e@isocpp.org>
References: <9a7a06c1-860e-44b1-a865-8467c39d7e91@isocpp.org>
 <CAGNvRgAk_Ry_yNkCR7cVNFty1qta2Pv_OvMXK3VJ=hrbDWPZrA@mail.gmail.com>
 <5846f36a-8119-4ec0-b1bd-fcfe1bce27f7@isocpp.org>
 <CAGNvRgA8fv=Jg+4HtwFM6zSGLdzf4PSadz9Cr8_5Zoemy2FW2w@mail.gmail.com>
 <024aea92-794f-435e-97a3-ad43dbc478bc@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_215_1380948859.1457017836955"
X-Trace: ger.gmane.org 1457017848 15506 80.91.229.3 (3 Mar 2016 15:10:48 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 3 Mar 2016 15:10:48 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDFIZEER6YPBB3VH4G3AKGQEDIVKWOI@isocpp.org Thu Mar 03 16:10:40 2016
Return-path: <std-proposals+bncBDFIZEER6YPBB3VH4G3AKGQEDIVKWOI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f200.google.com ([209.85.192.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDFIZEER6YPBB3VH4G3AKGQEDIVKWOI@isocpp.org>)
	id 1abUtj-0004zb-Vq
	for gclcip-std-proposals@m.gmane.org; Thu, 03 Mar 2016 16:10:40 +0100
Original-Received: by mail-pf0-f200.google.com with SMTP id o67sf37563392pfb.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 03 Mar 2016 07:10:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=YzzY6mpHZ2e3qQQJBJ41dYkvkG9liIUj1uFVDc6qXAQ=;
        b=orNWmN4JiVOYD0PYRBwb9yQvL3eGOc83PqtKbazUij29FuqrdvWtFGLOBtF+zFARmB
         Jq7JbogmfS9fzvXZOPhBNsn1EgKC+8EP5yZafgYMSUDWnBpJxsjpTgaw9L9rKy9cMecT
         UCZnlwrGkzGQkDyCc/tR+Ql5fe1H6Qn/S9LRi/T50qqQ6DIQfW1rNV7VQc/qR6Nmv0UN
         GdVUbmGWuGv7sbxIXVLEMiAAMxF6rzHNITNwRV+44V9QJcA+eLzvKjndGqFQTKbfTvnB
         f5uG4TGIVvlAgAYLcB6sSxMnhTQ3O8jH8BgdxUCCcEOwHC1x087BWNtKGnIxMjKiltfF
         /1tw==
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
         :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=YzzY6mpHZ2e3qQQJBJ41dYkvkG9liIUj1uFVDc6qXAQ=;
        b=KRO1QXwnNXVRK+h5x+8N7nJ2wMTVdwZgYuu60zRwJwCUi1XZvvGqyNajWaFJjEBMIV
         e7PaPtIOJsym0mlKYo+f+tX1QfmcKBSMKadKeZ/qoTHWWYnnboykeFntnrps2QDNPgHs
         PyKBGWyaR0Tfw8EVc7LUyP93LYgraP/rleT3Lv1L2MvnhzJff4DxYjpgtSTTQmw0aYlW
         RVpW3BjT9JKdJq0k4cDpfWLHrdNM3s+n5mwgtTeBSzx+GvLgR/HjETHvViFbeFobGFV8
         r26u8ajo95OlFqV4Hbb9eBzCU5zUvnkczrV79+EtYnz0mc9Y43yXMJtUypp56X67cBkX
         z/BA==
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:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=YzzY6mpHZ2e3qQQJBJ41dYkvkG9liIUj1uFVDc6qXAQ=;
        b=Zs8Vtq1Ui482eGBMYuhy4GuQLAfRTLg/vi3Wol3+vZEcp1cWmZElCl9xMTJnD437vF
         OJ1SKrVUoWbKpm4vo6EJwgV/GWYAdTlMrU8HnvwCmtUQlSG3f6ramEt/nld566jRtpgT
         0bsSOnrot+RqnEg0Yh054t4chbbTshJT5dNjhuVS0mY3pqEDviYycV3T9FcYd7cE/Sdm
         +dsxugWaN/7ocU2ZLZaigw6jeF4XijDngWmNfE3qHZR+fhadCmovwZfLbj/0f+Jtfapm
         f653P5d2DcYfkJ9AHeGOhp6hjVTJg04nHcglYGSsIDHrhrubj0MWVzxyrIHs+Il7gaOJ
         /x1g==
X-Gm-Message-State: AD7BkJKQYoNquiG98v4cl6XOhP2NA57RONaTFk26oVA3CTlQMReog1/GpeH14vMttRrUGw==
X-Received: by 10.98.74.203 with SMTP id c72mr2021302pfj.8.1457017838916;
        Thu, 03 Mar 2016 07:10:38 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.8.230 with SMTP id h99ls2360449ioi.75.gmail; Thu, 03 Mar
 2016 07:10:37 -0800 (PST)
X-Received: by 10.50.66.236 with SMTP id i12mr176812igt.7.1457017837896;
        Thu, 03 Mar 2016 07:10:37 -0800 (PST)
In-Reply-To: <024aea92-794f-435e-97a3-ad43dbc478bc@isocpp.org>
X-Original-Sender: martin.tillmann@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: <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:24899
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/24899>

------=_Part_215_1380948859.1457017836955
Content-Type: multipart/alternative; 
	boundary="----=_Part_216_1872725034.1457017836955"

------=_Part_216_1872725034.1457017836955
Content-Type: text/plain; charset=UTF-8


>
> I can't say that I would assume that this is what's going on. The code is 
> clearly calling a member function of `v`, so the natural assumption is that 
> the operation is mutating `v`.
>

Yes. All values that appear in the given range (here u) are removed from v.
 

>
> But I do agree that the call doesn't look like what it's doing. There's no 
> reason to assume that `erase` would be doing a *search* of a `vector`, 
> particularly when you're passing a range of iterators (not to mention, this 
> conflicts with an existing overload). If such a call were truly needed, it 
> clearly needs its own *name*.
>

erase already performs this functionality for single elements and ranges of 
the vector itself. 

-- 
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/73454c65-98c8-4327-a0f4-858652f5009e%40isocpp.org.

------=_Part_216_1872725034.1457017836955
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><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"><div>I can&#39;t say that I would assume that this is what&#39;s going =
on. The code is clearly calling a member function of `v`, so the natural as=
sumption is that the operation is mutating `v`.<br></div></div></blockquote=
><div><br>Yes. All values that appear in the given range (here <span style=
=3D"font-family: courier new,monospace;">u</span>) are removed from <span s=
tyle=3D"font-family: courier new,monospace;">v</span>.<br>=C2=A0</div><bloc=
kquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-l=
eft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br>But I do =
agree that the call doesn&#39;t look like what it&#39;s doing. There&#39;s =
no reason to assume that `erase` would be doing a <i>search</i> of a `vecto=
r`, particularly when you&#39;re passing a range of iterators (not to menti=
on, this conflicts with an existing overload). If such a call were truly ne=
eded, it clearly needs its own <i>name</i>.<br></div></div></blockquote><di=
v><br><span style=3D"font-family: courier new,monospace;">erase </span>alre=
ady performs this functionality for single elements and ranges of the vecto=
r itself. <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/73454c65-98c8-4327-a0f4-858652f5009e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/73454c65-98c8-4327-a0f4-858652f5009e=
%40isocpp.org</a>.<br />

------=_Part_216_1872725034.1457017836955--
------=_Part_215_1380948859.1457017836955--

.
