220 15372 <CAA7U3HNeFrGx4HkxKms84ZsQYGzpWK44WPi4piw8Tuc3_rbojQ@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: Mon, 29 Dec 2014 20:35:40 +0100
Lines: 42
Approved: news@gmane.org
Message-ID: <CAA7U3HNeFrGx4HkxKms84ZsQYGzpWK44WPi4piw8Tuc3_rbojQ@mail.gmail.com>
References: <0959f2f8-acdd-4786-b6f3-0f05c62dcee6@isocpp.org>
	<1467325.0dEsDvEnHx@tjmaciei-mobl4>
	<m7s218$hio$1@ger.gmane.org>
	<3990670.unDteUsXEa@tjmaciei-mobl4>
	<m7s6ek$mm3$1@ger.gmane.org>
	<232a2f25-0907-48e5-ba04-e1d9b09e19e7@isocpp.org>
	<m7s85a$d7k$1@ger.gmane.org>
	<cbfe539f-9e2c-4929-aa4b-c2b29c2300c9@isocpp.org>
	<CAA7U3HPqPs7Xr1-u5g1zp+yRcyWZGLfORFQnFCi2jP-3OxrZCA@mail.gmail.com>
	<34298b73-1e10-4efa-8527-e1caf84c719c@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 1419881753 21977 80.91.229.3 (29 Dec 2014 19:35:53 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 29 Dec 2014 19:35:53 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5NB45SSABBBDO2Q2SQKGQEQWBBHRA@isocpp.org Mon Dec 29 20:35:46 2014
Return-path: <std-proposals+bncBC5NB45SSABBBDO2Q2SQKGQEQWBBHRA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f72.google.com ([209.85.218.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5NB45SSABBBDO2Q2SQKGQEQWBBHRA@isocpp.org>)
	id 1Y5g6R-0005sO-Az
	for gclcip-std-proposals@m.gmane.org; Mon, 29 Dec 2014 20:35:43 +0100
Original-Received: by mail-oi0-f72.google.com with SMTP id e131sf243534367oig.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 29 Dec 2014 11:35:42 -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=FcAGpNanz2/UQLmnh2agRA+9vLZDnJO28izFdr7ki/s=;
        b=ZggqpwxSmNCjSoO/K/zgAiKabQ+DJ2bwlhR/jzJjcuvDlzDefVyaCuK+JyjPFuaaqC
         40ZRdNU5uwfhngtqI3Dmlc2GHGGd0Gq7U1X6Jmka26S6fIj0lzMyP1AM4F29XzMUqwLy
         wR2N23p8U7fzOfOU2VABNsl5o2bsbDfEUwzC2m3OILwTRHmbiHPlTSgNVGNMeTkbuGrS
         AE0zVpE7b1/68yjJOVF9uKzd5FjoR9TA0kGE0XMsrzZVN2jeqMteZL8Rr4B8cWtBnTUt
         mC10YlVHiOWTRRKKawzbJ1yP0w9p9OY/fQPXUUUO92IQOoA8ibewgNNvlSN7gjxcMkvH
         Vx/w==
X-Gm-Message-State: ALoCoQnnQ9WUmzFbB+rTNuPBhg4/I6byNS9LHIHXgJHGaLfzd1AWfcctkkNoB01UBC5gcx14eX/K
X-Received: by 10.182.29.39 with SMTP id g7mr42292803obh.36.1419881742144;
        Mon, 29 Dec 2014 11:35:42 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.94.118 with SMTP id f109ls7714324qge.27.gmail; Mon, 29 Dec
 2014 11:35:41 -0800 (PST)
X-Received: by 10.140.29.138 with SMTP id b10mr56449278qgb.34.1419881741281;
        Mon, 29 Dec 2014 11:35:41 -0800 (PST)
Original-Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com. [2607:f8b0:400d:c01::22e])
        by mx.google.com with ESMTPS id c6si15359095qan.115.2014.12.29.11.35.41
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 29 Dec 2014 11:35:41 -0800 (PST)
Received-SPF: pass (google.com: domain of olafvdspek@gmail.com designates 2607:f8b0:400d:c01::22e as permitted sender) client-ip=2607:f8b0:400d:c01::22e;
Original-Received: by mail-qc0-f174.google.com with SMTP id c9so9709170qcz.5
        for <std-proposals@isocpp.org>; Mon, 29 Dec 2014 11:35:41 -0800 (PST)
X-Received: by 10.229.225.195 with SMTP id it3mr42397721qcb.24.1419881741012;
 Mon, 29 Dec 2014 11:35:41 -0800 (PST)
Original-Received: by 10.229.151.70 with HTTP; Mon, 29 Dec 2014 11:35:40 -0800 (PST)
In-Reply-To: <34298b73-1e10-4efa-8527-e1caf84c719c@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:c01::22e 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:15372
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15372>

On Mon, Dec 29, 2014 at 8:34 PM, Leo Heinsaar <leoheinsaar@gmail.com> wrote:
>
>
> On Monday, December 29, 2014 11:26:52 PM UTC+4, Olaf van der Spek wrote:
>>
>> On Mon, Dec 29, 2014 at 8:17 PM, Leo Heinsaar <leohe...@gmail.com> wrote:
>> >> I can't think what behavior would be introduced that would be
>> >> surprising; can you please elaborate?
>> >
>> >
>> > On a general note: once we convert something to bool, there is no
>> > stopping
>> > it from interacting with other fundamental types from short to double.
>> > Just
>> > seems that for iterators, that might introduce unnecessary type-safety
>> > bugs.
>>
>> That's why we've got explicit operator bool.
>
>
> Well, originally, at least, Matthew wrote: "Maybe we could instead create a
> form of ::find() that returns an optional<iterator> or checked_iterator or
> similar, that can be implicitly cast to bool to test for validity."
>
> But even if it is made explicit, seems like it becomes too verbose to write
> static_cast<bool>.

Not necessary as if (v) and some other constructs count as explicit
conversions already...


-- 
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/.

.
