220 15330 <1a6e8394-b2f7-4c1a-b3cd-650b7968406f@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Leo Heinsaar <leoheinsaar@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Isn't it time we had the bool
 std::[container]::contains() family of methods?
Date: Fri, 26 Dec 2014 10:18:49 -0800 (PST)
Lines: 106
Approved: news@gmane.org
Message-ID: <1a6e8394-b2f7-4c1a-b3cd-650b7968406f@isocpp.org>
References: <0959f2f8-acdd-4786-b6f3-0f05c62dcee6@isocpp.org>
 <2df86492-548f-42c8-86d6-fe1c8ba3a5a9@isocpp.org>
 <2f390ec3-b259-4150-9771-cd0d02860348@isocpp.org>
 <3743ebda-3367-4fc3-922a-f38d98e57889@isocpp.org>
 <1bccb2dd-4aa4-4f07-8958-b1d6bf092630@isocpp.org>
 <CAA7U3HMcBab8xEJU7w_r3d4cQa8d-DYwVw4BxnsHM_UjyfjAmg@mail.gmail.com>
 <46cc4da5-98d1-471f-ab31-714ac5502853@isocpp.org>
 <CAA7U3HMk1gbRaRwHHDfEM9Ov2fAm7JVw588u8tfvfFAWDwZjzQ@mail.gmail.com>
 <6ad78bb4-b21b-4978-90be-b99ef6d15414@isocpp.org>
 <m7k5tf$aql$1@ger.gmane.org>
 <CAA7U3HPHTxoU5Q4XyubtgMvN35nrDXeDGtJ=3fFAR9_+n58QCw@mail.gmail.com>
 <m7k70e$ps0$1@ger.gmane.org>
 <CAA7U3HOC113RWp5JaYb_7uFvrRdNud5XW+wXibLieUQuCkOTgQ@mail.gmail.com>
 <1c016fbb-7268-4c69-b9ab-510fb78c4125@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_6335_2115259800.1419617930022"
X-Trace: ger.gmane.org 1419617939 23734 80.91.229.3 (26 Dec 2014 18:18:59 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 26 Dec 2014 18:18:59 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCFYDAXXQYEBBCWN62SAKGQEXRS6YPY@isocpp.org Fri Dec 26 19:18:53 2014
Return-path: <std-proposals+bncBCFYDAXXQYEBBCWN62SAKGQEXRS6YPY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f200.google.com ([209.85.192.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCFYDAXXQYEBBCWN62SAKGQEXRS6YPY@isocpp.org>)
	id 1Y4ZTQ-0005bB-FE
	for gclcip-std-proposals@m.gmane.org; Fri, 26 Dec 2014 19:18:52 +0100
Original-Received: by mail-pd0-f200.google.com with SMTP id r10sf77243095pdi.3
        for <gclcip-std-proposals@m.gmane.org>; Fri, 26 Dec 2014 10:18:51 -0800 (PST)
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:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=QhVbXQSQ28Obz8QKhKzzOZvWgXC0IANKNfPEm/wlUWg=;
        b=au25zKmVvIv6pQmjshQwbPxo63+APicYpBkAwtXy8RpNzVQ4KEgkgMshslA/BylAx3
         d40BhUb44eA6m3/jMJ1g/DdQoebwe8xONfQQ4q34Akx+g/yk/a8Olk5PRNC8VU4Dlw8c
         S1J3r+7XGNiXISz3l1KrEcM/wFHn2KylgqDMpfV1xHfhnEHisBcpzh6taqO8kiHz9e14
         vqQjYz2CKX4a9bbZ46n8ax+x6AfX1WOLtiSkeCgVdYYAzKs0+MvTCU/kDfNjmfFMdD8X
         7hCsIh/9JzCEkx645bCDe2cLIsLqALlHE2GI/WtLt03ZTtxUPbgijGZSE2DS5mkZe6qz
         Fm0g==
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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QhVbXQSQ28Obz8QKhKzzOZvWgXC0IANKNfPEm/wlUWg=;
        b=WRwffpsVAeBjkkCXp3x9ybUnifovQKJ8JCYaaNM810eyZ/wDNjxXuE6Hl4VlXPAhbq
         6BTS+kmly2xEvgrPyKKsUblcvOnnp1KJQlPkPR8nEQVomqxz3kOQp5jofMrvxD2404mh
         9G+jLhzsE83HfJq0GeO0Q9oslhHsrSbQ5hrSABtQif9953vAps/gf1lCxhBvgx6mJY1e
         kfXfQ+yfmMuY8Ua+JTArxDk53ty1cUSXnIYGMZLNPfzgY1mNZZURdKjnRKfmqFCL42Wg
         JyexQNugtxg8UbOAjKx5lqhaz1sU+Lg9ur+nPsdOUS4mmE7cIA23o9Mk5KEVjh9KaqK4
         ppPg==
X-Gm-Message-State: ALoCoQk4tqyLx+010P/1Pjz3pfNBPmKyJL6/i84R+xaDEp+FhbSV46/33YPX5fQF7FLRpubLj9Z9
X-Received: by 10.66.248.10 with SMTP id yi10mr31651841pac.0.1419617931193;
        Fri, 26 Dec 2014 10:18:51 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.97.73 with SMTP id l67ls1594549qge.69.gmail; Fri, 26 Dec
 2014 10:18:50 -0800 (PST)
X-Received: by 10.140.102.211 with SMTP id w77mr11791qge.28.1419617930365;
        Fri, 26 Dec 2014 10:18:50 -0800 (PST)
In-Reply-To: <1c016fbb-7268-4c69-b9ab-510fb78c4125@isocpp.org>
X-Original-Sender: leoheinsaar@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: <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:15330
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15330>

------=_Part_6335_2115259800.1419617930022
Content-Type: multipart/alternative; 
	boundary="----=_Part_6336_1727166162.1419617930022"

------=_Part_6336_1727166162.1419617930022
Content-Type: text/plain; charset=UTF-8


On Friday, December 26, 2014 10:02:07 PM UTC+4, Andy Prowl wrote:
>
> While I agree with most of what has been written in the last few messages, 
> I feel we are slowly diverging from the purpose of the original post, 
> perhaps unnecessarily enlarging its scope.
>

Yep guys, felt the same divergence.
 

> I think an algorithm like "contains()" for "containers" is such an obvious 
> and elementary operation that it ought to be in the standard library: it is 
> simpler, easier to teach, and easier to understand than the current "!= 
> end()" idiom.
>
>  
Exactly the point: a simple, easy-to-read, very-frequently-used, 
bool-returning contains(). If we want to recover an iterator, we just use 
find(), don't we? (And in cases like that the code usually isn't concerned 
about the existence of an element in a container, but wants to do 
something.)
 

> IMO a proposal should be written for adding this function, and keeping its 
> scope narrow may increase its chances to get accepted.
>
>
Perhaps it would be a good idea to at this point simply raise the awareness 
of the need for contains() and wait for concepts, without which, as Bjarne 
has also pointed out many times, it is hard to get all container algorithms 
perfect. The proposed ranges are also likely to affect.
 

> Kind regards,
>
> Andy
>

-- 

--- 
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_6336_1727166162.1419617930022
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br>On Friday, December 26, 2014 10:02:07 PM UTC+4, Andy P=
rowl 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">Wh=
ile I agree with most of what has been written in the last few messages, I =
feel we are slowly diverging from the purpose of the original post, perhaps=
 unnecessarily enlarging its scope.<br></div></blockquote><div><br></div><d=
iv>Yep guys, felt the same divergence.<br></div><div>&nbsp;</div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">I think an algorithm li=
ke "contains()" for "containers" is such an obvious and elementary operatio=
n that it ought to be in the standard library: it is simpler, easier to tea=
ch, and easier to understand than the current "!=3D end()" idiom.<br><br></=
div></blockquote><div>&nbsp;</div><div>Exactly the point: a simple, easy-to=
-read, very-frequently-used, bool-returning contains(). If we want to recov=
er an iterator, we just use find(), don't we? (And in cases like that the c=
ode usually isn't concerned about the existence of an element in a containe=
r, but wants to do something.)</div><div>&nbsp;</div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr">IMO a proposal should be written fo=
r adding this function, and keeping its scope narrow may increase its chanc=
es to get accepted.<br><div><br></div></div></blockquote><div><br></div><di=
v>Perhaps it would be a good idea to at this point simply raise the awarene=
ss of the need for contains() and wait for concepts, without which, as Bjar=
ne has also pointed out many times, it is hard to get all container algorit=
hms perfect. The proposed ranges are also likely to affect.</div><div>&nbsp=
;</div><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"><div>K=
ind regards,<br><br></div><div>Andy</div></div></blockquote></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_6336_1727166162.1419617930022--
------=_Part_6335_2115259800.1419617930022--

.
