220 15320 <CAA7U3HMk1gbRaRwHHDfEM9Ov2fAm7JVw588u8tfvfFAWDwZjzQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Olaf van der Spek <olafvdspek@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 17:29:17 +0100
Lines: 38
Approved: news@gmane.org
Message-ID: <CAA7U3HMk1gbRaRwHHDfEM9Ov2fAm7JVw588u8tfvfFAWDwZjzQ@mail.gmail.com>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1419611368 25782 80.91.229.3 (26 Dec 2014 16:29:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 26 Dec 2014 16:29:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5NB45SSABBBXUZ62SAKGQEJDYQMCQ@isocpp.org Fri Dec 26 17:29:21 2014
Return-path: <std-proposals+bncBC5NB45SSABBBXUZ62SAKGQEJDYQMCQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qg0-f72.google.com ([209.85.192.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5NB45SSABBBXUZ62SAKGQEJDYQMCQ@isocpp.org>)
	id 1Y4XlP-0003x7-NQ
	for gclcip-std-proposals@m.gmane.org; Fri, 26 Dec 2014 17:29:19 +0100
Original-Received: by mail-qg0-f72.google.com with SMTP id f51sf29410669qge.7
        for <gclcip-std-proposals@m.gmane.org>; Fri, 26 Dec 2014 08:29:18 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=E452qNZeHCJxCbpPOqSOUhv68JGHuAML0lOVCWZ8fjs=;
        b=Tyo5neyXWpWfHHk6wSiWHOvBe3Mb8toGX7wXLpBzFL/c8BXVyF28CTHXGUv2gPspl4
         VxG0NNWnTCl+ssiV1tvVfWnsKbnY+RkKpTQ/mYP6WnMGsMebJoZd/LLPTsRHqLqENmT/
         yP424jIMJ+XHhORpsctXGyRi8cvwkmoDX9MHKlWDGsa+/WrYIVrKx8LZE2s/vgqZAYIo
         qKVOdAqZNzEFvyWTM/Iho3IWoVj5EMK5Uj+bUj4Nyk07Nm9wrXeuHm/7uUc3yun6VDqT
         CE4e1ruy2gJzR5YMhhikJu4eQlH0mUpz0zM41P1FUa7ZCvezEF1ruIJSDdaMbeT4OaoF
         37og==
X-Gm-Message-State: ALoCoQnpN1xugBNUBH9DFedGXIy5fqK5SrLiCsFQ7yxlphpAcAjqQqc0dNItG2MTpvV59I7t8JzJ
X-Received: by 10.236.223.198 with SMTP id v66mr33253799yhp.21.1419611358849;
        Fri, 26 Dec 2014 08:29:18 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.105.75 with SMTP id b69ls4999392qgf.80.gmail; Fri, 26 Dec
 2014 08:29:18 -0800 (PST)
X-Received: by 10.224.37.5 with SMTP id v5mr71284537qad.25.1419611358234;
        Fri, 26 Dec 2014 08:29:18 -0800 (PST)
Original-Received: from mail-qa0-x22d.google.com (mail-qa0-x22d.google.com. [2607:f8b0:400d:c00::22d])
        by mx.google.com with ESMTPS id m3si32241802qaa.31.2014.12.26.08.29.18
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 26 Dec 2014 08:29:18 -0800 (PST)
Received-SPF: pass (google.com: domain of olafvdspek@gmail.com designates 2607:f8b0:400d:c00::22d as permitted sender) client-ip=2607:f8b0:400d:c00::22d;
Original-Received: by mail-qa0-f45.google.com with SMTP id f12so5841232qad.18
        for <std-proposals@isocpp.org>; Fri, 26 Dec 2014 08:29:18 -0800 (PST)
X-Received: by 10.224.65.69 with SMTP id h5mr70483987qai.69.1419611358070;
 Fri, 26 Dec 2014 08:29:18 -0800 (PST)
Original-Received: by 10.229.151.70 with HTTP; Fri, 26 Dec 2014 08:29:17 -0800 (PST)
In-Reply-To: <46cc4da5-98d1-471f-ab31-714ac5502853@isocpp.org>
X-Original-Sender: olafvdspek@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of olafvdspek@gmail.com designates 2607:f8b0:400d:c00::22d as
 permitted sender) smtp.mail=olafvdspek@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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:15320
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15320>

On Fri, Dec 26, 2014 at 2:31 PM, Leo Heinsaar <leoheinsaar@gmail.com> wrote:
> On Friday, December 26, 2014 4:50:15 PM UTC+4, Olaf van der Spek wrote:
>>
>> On Fri, Dec 26, 2014 at 10:30 AM, Leo Heinsaar <leohe...@gmail.com> wrote:
>> > Sorry Andy - I took a closer look at Bjarne's proposal; it seems like if
>> > it
>> > goes through, we'll indeed be able to have a global contains() with all
>> > the
>> > benefits with respect to having it for arrays and such, invokable via
>> > vec.contains(x) syntax. (It really is about nicer syntax as well as less
>> > - a
>> > lot less - typing.)
>>
>> How is it less typing? Auto-complete?
>
>
> Since we'll be able to simply write
>
> phone_book.contains(number)
>
> instead of:
>
> phone_book.find(number) != phone_book.end()
>
> Not to mention how much more clearly the simplified version, as they like to
> call it, expresses intent.

I thought that was an argument against a free function.
Today one can already write phone_book.count(number);

-- 

--- 
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/.

.
