220 14516 <CADbh+eS+nGHpqRBUCbUFGX3+fXWiiCD0C=nvjpAUZDm_=+N2-g@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Brent Friedman <fourthgeek@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Range-based if
Date: Wed, 12 Nov 2014 20:31:35 -0600
Lines: 110
Approved: news@gmane.org
Message-ID: <CADbh+eS+nGHpqRBUCbUFGX3+fXWiiCD0C=nvjpAUZDm_=+N2-g@mail.gmail.com>
References: <CADbh+eQCaTPArs7YBUg9mYwrnJ2Gu3SRAfqUbPiLscpyxV8JqQ@mail.gmail.com>
	<m3tvcu$9ia$1@ger.gmane.org>
	<CADbh+eScmZMj4dcQv73re1dM0VNbw_PeHRc_FPWNONoKNKsiMg@mail.gmail.com>
	<c1a0a498-adca-44c7-a9fc-67a979967e6a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11352dfcaa83040507b44ffd
X-Trace: ger.gmane.org 1415845904 11965 80.91.229.3 (13 Nov 2014 02:31:44 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 13 Nov 2014 02:31:44 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCHLPXGUXMJBBB5QSCRQKGQEQJ374VI@isocpp.org Thu Nov 13 03:31:38 2014
Return-path: <std-proposals+bncBCHLPXGUXMJBBB5QSCRQKGQEQJ374VI@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+bncBCHLPXGUXMJBBB5QSCRQKGQEQJ374VI@isocpp.org>)
	id 1XokC9-0001qK-4x
	for gclcip-std-proposals@m.gmane.org; Thu, 13 Nov 2014 03:31:37 +0100
Original-Received: by mail-oi0-f72.google.com with SMTP id u20sf59593921oif.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 12 Nov 2014 18:31:36 -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:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=JM2VKKzi4+pSrvwI9g+hVN+PjT/IR8vda9XNieIvA+w=;
        b=fl9BFXBMgSr4Gy8zepWLG5DJQ49wdeOubrpIGLGZue6YR7YHWCQlxBIAqoObFN/ppj
         fQk6AeKKY2nXyjKwAedovhjTh5xCeJE03jtkk+KsL4vKvfNjT4WVgjf1M//6a/tag6Vw
         czYGSdOJ0nvCAr8PeGNM/i2OZ9MUGbUO/+Kk5yDfx7K8o9ijc4qispmmHCHD2jJsRHcL
         PtpQYh9GYGmaazDGq7JvUOtQk1NmM3lcp0FzT2vs2u6cjWMNgnd7vJfnj2pE5uP9qpp9
         +PMEV5GLlyMO8lziTLT5hSe0K8JqyES3mYthNkRRmgzUdj/ctm8mNlXQunPG4jg9Y6pP
         YR+A==
X-Gm-Message-State: ALoCoQkvzIqmaNbL39X9Fc5iBvXAsdYjaAvlxtV8YJ8MnwYgIwntDsbSOf96oxXzsW6xpn0RkA7k
X-Received: by 10.182.128.71 with SMTP id nm7mr41689860obb.22.1415845896475;
        Wed, 12 Nov 2014 18:31:36 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.106.13 with SMTP id gq13ls1155858obb.27.gmail; Wed, 12 Nov
 2014 18:31:35 -0800 (PST)
X-Received: by 10.60.94.73 with SMTP id da9mr41980923oeb.10.1415845895753;
        Wed, 12 Nov 2014 18:31:35 -0800 (PST)
Original-Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com. [2607:f8b0:4003:c06::22a])
        by mx.google.com with ESMTPS id e2si500376oia.140.2014.11.12.18.31.35
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 12 Nov 2014 18:31:35 -0800 (PST)
Received-SPF: pass (google.com: domain of fourthgeek@gmail.com designates 2607:f8b0:4003:c06::22a as permitted sender) client-ip=2607:f8b0:4003:c06::22a;
Original-Received: by mail-oi0-f42.google.com with SMTP id v63so459483oia.1
        for <std-proposals@isocpp.org>; Wed, 12 Nov 2014 18:31:35 -0800 (PST)
X-Received: by 10.202.197.199 with SMTP id v190mr39542687oif.2.1415845895630;
 Wed, 12 Nov 2014 18:31:35 -0800 (PST)
Original-Received: by 10.202.232.77 with HTTP; Wed, 12 Nov 2014 18:31:35 -0800 (PST)
In-Reply-To: <c1a0a498-adca-44c7-a9fc-67a979967e6a@isocpp.org>
X-Original-Sender: fourthgeek@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of fourthgeek@gmail.com designates 2607:f8b0:4003:c06::22a as
 permitted sender) smtp.mail=fourthgeek@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:14516
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14516>

--001a11352dfcaa83040507b44ffd
Content-Type: text/plain; charset=UTF-8

> It doesn't assume that the iterators are pointers, if that's what you
mean.
It assumes that it is possible to convert from nullptr_t to
decltype(&range.begin()).
It also assumes that this value constructed from nullptr necessarily
represents an invalid value (converts to false) for that iterator type.

On Wed, Nov 12, 2014 at 7:43 PM, Benjamin Lindley <benjameslindley@gmail.com
> wrote:

>
>
> On Tuesday, November 11, 2014 8:39:34 PM UTC-6, Brent Friedman wrote:
>>
>> > auto first_or_null(auto range) -> decltype(&range.begin())
>>
>> This assumes pointers, which while addressing some use cases it isn't
>> sufficient for the general case.
>>
>>
> What case does it not handle? And what exactly do you mean by "This
> assumes pointers"? It doesn't assume that the iterators are pointers, if
> that's what you mean.
>
> --
>
> ---
> 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/.
>

-- 

--- 
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/.

--001a11352dfcaa83040507b44ffd
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt;=C2=A0<span style=3D"font-family:arial,sans-serif;font=
-size:13px">It doesn&#39;t assume that the iterators are pointers, if that&=
#39;s what you mean.</span><div><span style=3D"font-family:arial,sans-serif=
;font-size:13px">It assumes that it is possible to convert from nullptr_t t=
o=C2=A0</span><span style=3D"font-family:arial,sans-serif;font-size:13px">d=
ecltype(&amp;range.begin()). It also assumes that this value constructed fr=
om nullptr necessarily represents an invalid value (converts to false) for =
that iterator type.</span></div></div><div class=3D"gmail_extra"><br><div c=
lass=3D"gmail_quote">On Wed, Nov 12, 2014 at 7:43 PM, Benjamin Lindley <spa=
n dir=3D"ltr">&lt;<a href=3D"mailto:benjameslindley@gmail.com" target=3D"_b=
lank">benjameslindley@gmail.com</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><span class=3D""><br><br>On Tuesday, Novembe=
r 11, 2014 8:39:34 PM UTC-6, Brent Friedman wrote:<blockquote class=3D"gmai=
l_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div dir=3D"ltr">&gt;<span style=3D"font-family:arial,sans-s=
erif;font-size:13px">=C2=A0auto first_or_null(auto range) -&gt; decltype(&a=
mp;range.begin())</span><div><br></div><div>This assumes pointers, which wh=
ile addressing some use cases it isn&#39;t sufficient for the general case.=
</div><div><br></div></div></blockquote></span><div><br>What case does it n=
ot handle? And what exactly do you mean by &quot;This assumes pointers&quot=
;? It doesn&#39;t assume that the iterators are pointers, if that&#39;s wha=
t you mean. <br></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--001a11352dfcaa83040507b44ffd--

.
