220 7743 <CAPBZbvyBzrf-r1PXEFLmKdoXO6AYAK0r1UNLpZ=Dm3+PGctoew@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "Billy O'Neal" <billy.oneal@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: A proposal to add lambda/function traits to
 the STL
Date: Wed, 13 Nov 2013 13:27:15 -0800
Lines: 233
Approved: news@gmane.org
Message-ID: <CAPBZbvyBzrf-r1PXEFLmKdoXO6AYAK0r1UNLpZ=Dm3+PGctoew@mail.gmail.com>
References: <203889a9-743f-4083-ba9b-fd15506b2e86@isocpp.org>
 <ec821a32-34e3-4a0b-a635-d5eb17250e97@isocpp.org> <CAPBZbvwXVOx3hm_y-xatrVffd4NzmwcXhkx4Fvcj4C-dQpepbg@mail.gmail.com>
 <e4bd23cd-e956-4aeb-acf0-6b5e1f0b05f7@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e013d0db0724dca04eb15a3ee
X-Trace: ger.gmane.org 1384378074 4716 80.91.229.3 (13 Nov 2013 21:27:54 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 13 Nov 2013 21:27:54 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDKLBLVE6ADBBXG5R6KAKGQEPPV5HAQ@isocpp.org Wed Nov 13 22:28:01 2013
Return-path: <std-proposals+bncBDKLBLVE6ADBBXG5R6KAKGQEPPV5HAQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pb0-f69.google.com ([209.85.160.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDKLBLVE6ADBBXG5R6KAKGQEPPV5HAQ@isocpp.org>)
	id 1Vghyg-0003m8-Cy
	for gclcip-std-proposals@m.gmane.org; Wed, 13 Nov 2013 22:27:58 +0100
Original-Received: by mail-pb0-f69.google.com with SMTP id md4sf1961217pbc.8
        for <gclcip-std-proposals@m.gmane.org>; Wed, 13 Nov 2013 13:27:57 -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:from:date
         :message-id:subject: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=luYm37bZRQoJnbFuaP/fGTR1qn+G2cKaxX8Wl/u20W8=;
        b=KrBQRP+Q1xBcPwXLqBywNSK6Qz75R46ufrozLnyNCQf+WHO3iB3yqKGixnoofdIg9B
         MNS6r9ze0DdkXg6b6ps+yATzp1NaB9e9yJVpBrYHjs5uOuQnCHBhNLOivl3ePghf8B12
         fq95R3ITkoyXBrkvqRGsdEmFusnRWe6jbl5iOYBY8LhL2adQnSx18JKbum7uj0jz3q/j
         qHDBZEmnKMZCULuYC9ocxPzAd5iVTr1pUov72kicEo2CjEF/4XGzjfUwOA/k7M3kUSjv
         N3OU9JjsYBrTok1UbTVHQPcpeqCRHpqyTI2my7tMsqbsMy87tJOHESBmdOR/MQQziuWz
         4C4w==
X-Gm-Message-State: ALoCoQnOqwl0fVaJQuhWYZG2GRD6IoBFVxVJd6TAltEZZND+BHCFJMeQdv0C3YI1rqLJbRGEx2g5
X-Received: by 10.66.164.41 with SMTP id yn9mr14564150pab.7.1384378077202;
        Wed, 13 Nov 2013 13:27:57 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.119.9 with SMTP id kq9ls693162qeb.48.gmail; Wed, 13 Nov
 2013 13:27:56 -0800 (PST)
X-Received: by 10.236.123.144 with SMTP id v16mr457972yhh.213.1384378076485;
        Wed, 13 Nov 2013 13:27:56 -0800 (PST)
Original-Received: from mail-oa0-x22d.google.com (mail-oa0-x22d.google.com [2607:f8b0:4003:c02::22d])
        by mx.google.com with ESMTPS id k66si3717610yhj.95.2013.11.13.13.27.56
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 13 Nov 2013 13:27:56 -0800 (PST)
Received-SPF: pass (google.com: domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::22d as permitted sender) client-ip=2607:f8b0:4003:c02::22d;
Original-Received: by mail-oa0-f45.google.com with SMTP id m1so1204463oag.32
        for <std-proposals@isocpp.org>; Wed, 13 Nov 2013 13:27:56 -0800 (PST)
X-Received: by 10.182.113.195 with SMTP id ja3mr19434674obb.46.1384378075856;
 Wed, 13 Nov 2013 13:27:55 -0800 (PST)
Original-Received: by 10.182.87.37 with HTTP; Wed, 13 Nov 2013 13:27:15 -0800 (PST)
In-Reply-To: <e4bd23cd-e956-4aeb-acf0-6b5e1f0b05f7@isocpp.org>
X-Original-Sender: billy.oneal@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::22d as
 permitted sender) smtp.mail=billy.oneal@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7743
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7743>

--089e013d0db0724dca04eb15a3ee
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Not quite -- this detection fails for other stateless functions, e.g.

struct MyFunctor
{
    // Stateless
    void operator()(int x)
    {
        // ...
    }
};
If you want to test whether the thing is convertible to a function pointer,
use std::is_convertible<http://en.cppreference.com/w/cpp/types/is_convertib=
le>--
it already exists and answers the question you really are asking here.

Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com


On Wed, Nov 13, 2013 at 1:23 PM, <morwenn29@gmail.com> wrote:

> It means that its capture list is empty. This can be useful since a lambd=
a
> without a capture list can be converted to a function pointer.
>
> Le mercredi 13 novembre 2013 22:11:15 UTC+1, Billy O'Neal a =E9crit :
>>
>> What does it mean that a lambda is stateless?
>>
>> Billy O'Neal
>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>> http://stackoverflow.com/users/82320/billy-oneal
>> Malware Response Instructor - BleepingComputer.com
>>
>>
>> On Wed, Nov 13, 2013 at 1:09 PM, <morw...@gmail.com> wrote:
>>
>>>  Something that came up today on StackOverflow:
>>> http://stackoverflow.com/questions/19961873/test-if-a-
>>> lambda-is-stateless
>>>
>>> You might want to add such a trait to your proposal to check whether a
>>> lambda is stateless :)
>>>
>>> Le mercredi 6 novembre 2013 19:35:18 UTC+1, Emil 'Skeen' Madsen a =E9cr=
it :
>>>>
>>>> I just finished writing the first draft of my first proposal ever.
>>>> And before submitting it, I'd like to discuss the matter at hand, and
>>>> the proposal at this forum.
>>>>
>>>> The proposal is about adding traits, to determine a lambdas return and
>>>> argument type(s) at compile time, to the standard library.
>>>>
>>>> Have a look,
>>>> I'm open to all kinds of criticism and feedback :)
>>>>
>>>> // Emil 'Skeen' Madsen.
>>>>
>>>  --
>>>
>>> ---
>>> 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-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@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/.
>

--=20

---=20
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 e=
mail 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-proposa=
ls/.

--089e013d0db0724dca04eb15a3ee
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Not quite -- this detection fails for other stateless=
 functions, e.g. </div><div>=A0</div><div><font face=3D"courier new,monospa=
ce">struct MyFunctor<br>{<br>=A0=A0=A0 // Stateless<br>=A0=A0=A0 void opera=
tor()(int x)<br>

=A0=A0=A0 {<br>=A0=A0=A0=A0=A0=A0=A0 // ...<br>=A0=A0=A0 }<br>};</font><br>=
</div><div>If you want to test whether the thing is convertible to a functi=
on pointer, use <a href=3D"http://en.cppreference.com/w/cpp/types/is_conver=
tible">std::is_convertible</a> -- it already exists and answers the questio=
n you really are asking here.</div>

</div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><d=
iv>Billy O&#39;Neal</div><div><a href=3D"https://bitbucket.org/BillyONeal/"=
 target=3D"_blank">https://github.com/BillyONeal/</a></div><div><a href=3D"=
http://stackoverflow.com/users/82320/billy-oneal" target=3D"_blank">http://=
stackoverflow.com/users/82320/billy-oneal</a></div>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Wed, Nov 13, 2013 at 1:23 PM,  <span =
dir=3D"ltr">&lt;<a href=3D"mailto:morwenn29@gmail.com" target=3D"_blank">mo=
rwenn29@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir=3D"ltr">It means that its capture list is empty. This can be usefu=
l since a lambda without a capture list can be converted to a function poin=
ter.<br><br>Le mercredi 13 novembre 2013 22:11:15 UTC+1, Billy O&#39;Neal a=
 =E9crit=A0:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
..8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:=
1px;border-left-style:solid">

<div class=3D"im"><div dir=3D"ltr">What does it mean that a lambda is state=
less?</div></div><div><div class=3D"im"><br clear=3D"all"><div><div dir=3D"=
ltr"><div>Billy O&#39;Neal</div><div><a href=3D"https://bitbucket.org/Billy=
ONeal/" target=3D"_blank">https://github.com/BillyONeal/</a></div>



<div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D=
"_blank">http://stackoverflow.com/<u></u>users/82320/billy-oneal</a></div><=
div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div class=3D"im">On Wed, Nov 13, =
2013 at 1:09 PM,  <span dir=3D"ltr">&lt;<a>morw...@gmail.com</a>&gt;</span>=
 wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-w=
idth:1px;border-left-style:solid">

<div class=3D"im">

<div dir=3D"ltr">Something that came up today on StackOverflow: <a href=3D"=
http://stackoverflow.com/questions/19961873/test-if-a-lambda-is-stateless" =
target=3D"_blank">http://stackoverflow.com/<u></u>questions/19961873/test-i=
f-a-<u></u>lambda-is-stateless</a><br>



<br>You might want to add such a trait to your proposal to check whether a =
lambda is stateless :)<br><br>Le mercredi 6 novembre 2013 19:35:18 UTC+1, E=
mil &#39;Skeen&#39; Madsen a =E9crit=A0:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204=
,204,204);border-left-width:1px;border-left-style:solid">



<div dir=3D"ltr">I just finished writing the first draft of my first propos=
al ever.<br>And before submitting it, I&#39;d like to discuss the matter at=
 hand, and the proposal at this forum.<br><br>The proposal is about adding =
traits, to determine a lambdas return and argument type(s) at compile time,=
 to the standard library.<br>



<br>Have a look,<br>I&#39;m open to all kinds of criticism and feedback :)<=
br><br>// Emil &#39;Skeen&#39; Madsen.<span><font color=3D"#888888"><br></f=
ont></span></div></blockquote></div></div><span><font color=3D"#888888"><di=
v class=3D"im">



<p></p>

-- <br>
=A0<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br></div>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a>std-proposal...@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a>std-pr...@isocpp.org</a>.<div class=
=3D"im"><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/<u></u>isocpp.=
org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=A0<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%2Bunsubscribe@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 />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--089e013d0db0724dca04eb15a3ee--

.
