220 15371 <34298b73-1e10-4efa-8527-e1caf84c719c@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: Mon, 29 Dec 2014 11:34:30 -0800 (PST)
Lines: 94
Approved: news@gmane.org
Message-ID: <34298b73-1e10-4efa-8527-e1caf84c719c@isocpp.org>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_632_571036662.1419881670535"
X-Trace: ger.gmane.org 1419881680 21100 80.91.229.3 (29 Dec 2014 19:34:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 29 Dec 2014 19:34:40 +0000 (UTC)
Cc: mw_triad@users.sourceforge.net
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCFYDAXXQYEBBRWZQ2SQKGQEOE62N5I@isocpp.org Mon Dec 29 20:34:34 2014
Return-path: <std-proposals+bncBCFYDAXXQYEBBRWZQ2SQKGQEOE62N5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f72.google.com ([209.85.220.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCFYDAXXQYEBBRWZQ2SQKGQEOE62N5I@isocpp.org>)
	id 1Y5g5I-0004p5-Ua
	for gclcip-std-proposals@m.gmane.org; Mon, 29 Dec 2014 20:34:33 +0100
Original-Received: by mail-pa0-f72.google.com with SMTP id kq14sf111883501pab.11
        for <gclcip-std-proposals@m.gmane.org>; Mon, 29 Dec 2014 11:34:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc: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=nXD7qWMaGj6P/470x6s999GhJzXurta/W5H6AiJnXNA=;
        b=kiyQb32tr3XjXhvBiE+DMFtLQes3c6RmVBnFjRo324dOulkt7w2mUlP+U+JxDw4D7v
         8i2dig+AamD195Vd5lA87RZJLOXIFi1p9Dm9NU61ejIPdT6gXhynYUfHRt14uwgJYQK8
         d4ENzN0Dc/+1Ev5zA54DLHY8Y/qKKZZ4U2zgnRXszQED1aJyZYrp27X0oORzhYLfLnie
         apQVq3A1BygVxBywREhPuj7y1XA6EKO68ZxPKRIY5TDUdCU17/EreLtY1M7FNIvH5jyL
         UFqM37pl79AaWQMMfaOOEBMnBD6Kxvd3CncRVnnTVvQwnuTV8Xbhqm+eu8yXH1Lg9zRI
         pCvg==
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:cc: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=nXD7qWMaGj6P/470x6s999GhJzXurta/W5H6AiJnXNA=;
        b=B2Sx5nQQ4xve+GEYztYYxNzwO01GrW//knZFAqLlr14kui2+3AErrHn1XkJ5znla2D
         xdLTotuyNtR3GrPs3Xs3Dp0Ps5ZDizcSaK03Mc+sJNFOeE2A7PWUt8+uWTgFz3o/ork4
         Ga+5qCGo2oEfNo+DOZPFvaclTkrXUpEJkkHSYdI7jaulHtSudOzTxvQpMHoelcZ0yXu7
         sWDccSADeaSF2JAOIL4vcLHs+rxloweOls1hi8XoDXxYHGnTTF56gFIELWR++52iiuE1
         0BfdZxufMpR87QVpK1veu7ols6f9tO9nvxFxoRoZhbltm0QfwutS/z7qb+MSFQUVcKgR
         V/zg==
X-Gm-Message-State: ALoCoQkRC9MwZuXFfRSRizK/KxkhRZadCzgJq1c0XXtbI70AQmgWI7ObYZKCxxzTYz7guKOflk+U
X-Received: by 10.66.66.1 with SMTP id b1mr43768365pat.8.1419881671704;
        Mon, 29 Dec 2014 11:34:31 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.107.181 with SMTP id h50ls7821186qgf.85.gmail; Mon, 29 Dec
 2014 11:34:30 -0800 (PST)
X-Received: by 10.140.16.55 with SMTP id 52mr17455qga.31.1419881670790;
        Mon, 29 Dec 2014 11:34:30 -0800 (PST)
In-Reply-To: <CAA7U3HPqPs7Xr1-u5g1zp+yRcyWZGLfORFQnFCi2jP-3OxrZCA@mail.gmail.com>
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:15371
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15371>

------=_Part_632_571036662.1419881670535
Content-Type: multipart/alternative; 
	boundary="----=_Part_633_308759791.1419881670535"

------=_Part_633_308759791.1419881670535
Content-Type: text/plain; charset=UTF-8



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 
> <javascript:>> 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>*.

Leo

-- 

--- 
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_633_308759791.1419881670535
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 29, 2014 11:26:52 PM UTC+4, Ol=
af van der Spek wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Mon, =
Dec 29, 2014 at 8:17 PM, Leo Heinsaar &lt;<a href=3D"javascript:" target=3D=
"_blank" gdf-obfuscated-mailto=3D"J7tktPO0joEJ" onmousedown=3D"this.href=3D=
'javascript:';return true;" onclick=3D"this.href=3D'javascript:';return tru=
e;">leohe...@gmail.com</a>&gt; wrote:
<br>&gt;&gt; I can't think what behavior would be introduced that would be
<br>&gt;&gt; surprising; can you please elaborate?
<br>&gt;
<br>&gt;
<br>&gt; On a general note: once we convert something to bool, there is no =
stopping
<br>&gt; it from interacting with other fundamental types from short to dou=
ble. Just
<br>&gt; seems that for iterators, that might introduce unnecessary type-sa=
fety bugs.
<br>
<br>That's why we've got explicit operator bool.
</blockquote><div>&nbsp;</div><div>Well, originally, at least, Matthew wrot=
e: "Maybe we could instead create a form of ::find() that returns=20
an optional&lt;iterator&gt; or checked_iterator or similar, that can=20
be <b>implicitly</b> cast to bool to test for validity."</div><div><br></di=
v><div>But even if it is made explicit, seems like it becomes too verbose t=
o write&nbsp;<b>static_cast&lt;bool&gt;</b>.</div><div><br></div><div>Leo</=
div></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_633_308759791.1419881670535--
------=_Part_632_571036662.1419881670535--

.
