220 15443 <CAA7U3HM6DTadGhMgQp9xMRN3KQpnPxju0fxEKwniANBCksY3-w@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: Sat, 3 Jan 2015 16:03:48 +0100
Lines: 44
Approved: news@gmane.org
Message-ID: <CAA7U3HM6DTadGhMgQp9xMRN3KQpnPxju0fxEKwniANBCksY3-w@mail.gmail.com>
References: <0959f2f8-acdd-4786-b6f3-0f05c62dcee6@isocpp.org>
	<3516872.4RhFvKrMWZ@tjmaciei-mobl4>
	<CALb3uoa+_WoCOHro11Wbc4=y=uM306U1FwsDYqsGOhfjbbQdnw@mail.gmail.com>
	<1457087.mBB46HcHFC@tjmaciei-mobl4>
	<CALb3uoZj6bjg=SRsRQsv5gkbjiCOedD1jXiKOzh_LNzZT-w=zw@mail.gmail.com>
	<m7ujut$8oh$1@ger.gmane.org>
	<085f07b9-6679-40ae-a737-69c70aab4e21@isocpp.org>
	<m7v2hp$860$1@ger.gmane.org>
	<30754b0a-21b7-438d-90e6-50bd3920dc2f@isocpp.org>
	<5f44a82a-94ce-4b1e-91a1-3f7e01bd2d88@isocpp.org>
	<60f5e629-950c-4d60-ae4b-12f74ea762b7@isocpp.org>
	<d8d7e8de-a7dc-48ea-9fa9-15d5cc4b4fd1@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 1420297439 8674 80.91.229.3 (3 Jan 2015 15:03:59 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 3 Jan 2015 15:03:59 +0000 (UTC)
Cc: mw_triad@users.sourceforge.net
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5NB45SSABBBVMJUCSQKGQEB2OGEAI@isocpp.org Sat Jan 03 16:03:52 2015
Return-path: <std-proposals+bncBC5NB45SSABBBVMJUCSQKGQEB2OGEAI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5NB45SSABBBVMJUCSQKGQEB2OGEAI@isocpp.org>)
	id 1Y7QF4-00019I-Qh
	for gclcip-std-proposals@m.gmane.org; Sat, 03 Jan 2015 16:03:50 +0100
Original-Received: by mail-ie0-f197.google.com with SMTP id x19sf119332931ier.8
        for <gclcip-std-proposals@m.gmane.org>; Sat, 03 Jan 2015 07:03:50 -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:cc: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=rrFaM8rHEtFe1sH0KUZJy6aJQdP8zHhBoSIx1v43wp4=;
        b=CfCFcssMb2TXQB/tbqwgu+gW1hqjJ3N/YbD0rkVpeKysOwrIpOJ03sQ49A+pyRACOg
         tTDx4D050YSeQ+C469gE4MSZb9aKVpMcAC3ivDEqIB57N+s7g2GJzDLlBVt+GKQh8Eyr
         4XAtzR4OjM605DMvBS596fDuw1x/Hit/kxt1rlcd+Kxrt0qUTZxPmrrAufPUOUib7PCm
         nlkjIYLtb2+6OONXtpUmsufnyV+GDbHLpINyqUB1aXMPMTGZaID2V8XwFCHSENUzXOZ2
         r0FGpFZurnssbhM5p6ZE+V2JJLOcFW7GwU6JiziS6nNSe365B2T/jXpPmk5c+fSduO3Z
         yFaQ==
X-Gm-Message-State: ALoCoQniJI17L3mVx5BujN1i5MDuENWeD9huL1VGmu9XjxsdI0VICJ8U4sbFwyMTZ6diKY7tWnkh
X-Received: by 10.182.55.99 with SMTP id r3mr48357568obp.8.1420297430040;
        Sat, 03 Jan 2015 07:03:50 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.49.3 with SMTP id p3ls5080150qga.46.gmail; Sat, 03 Jan
 2015 07:03:49 -0800 (PST)
X-Received: by 10.224.67.132 with SMTP id r4mr68657100qai.1.1420297429216;
        Sat, 03 Jan 2015 07:03:49 -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 t64si55150546qgt.111.2015.01.03.07.03.49
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 03 Jan 2015 07:03:49 -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 f12so12143751qad.18
        for <std-proposals@isocpp.org>; Sat, 03 Jan 2015 07:03:49 -0800 (PST)
X-Received: by 10.224.54.2 with SMTP id o2mr131546136qag.63.1420297429111;
 Sat, 03 Jan 2015 07:03:49 -0800 (PST)
Original-Received: by 10.229.151.70 with HTTP; Sat, 3 Jan 2015 07:03:48 -0800 (PST)
In-Reply-To: <d8d7e8de-a7dc-48ea-9fa9-15d5cc4b4fd1@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:15443
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15443>

On Sat, Jan 3, 2015 at 3:55 PM, Andy Prowl <andy.prowl@gmail.com> wrote:
> Single Responsibility Principle. As I mentioned, I'm aware this is a
> subjective argument :)

It has a lot of objective aspects though.

>> Pointers can be used instead of 'checked' iterators. Pointers surely have
>> no performance or memory overhead. ;)
>> Obviously you lose the iterator but that's the same for contains().
>
>
> Yes, but contains() is explicitly mean for those cases where the iterator
> doesn't matter. I don't think the same can be said of find().

I think it can, especially with maps. See my find_ptr wrapper.

>> AFAIK the return type of binary_search was a mistake.
>
>
> OK, didn't know that. Can you provide some more background on this?

No, sorry, but a quick search turns up lots of questions why it
doesn't return an iterator.

>> IMO a variant taking a range makes sense with or without range proposal.
>
>
> Probably yes, although I'm afraid it would still be inconvenient enough (due
> to the begin()/end() noise) for users to opt for a custom wrapper, which
> would defeat the purpose.

I don't understand, a variant taking a range/container would NOT
require you to write begin() and end().

Olaf

-- 

--- 
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/.

.
