Topic: Sugestion: std::invoke
Author: jgottman6@gmail.com
Date: Wed, 17 Jul 2013 15:37:24 -0700 (PDT)
Raw View
------=_Part_10_6413373.1374100644947
Content-Type: text/plain; charset=ISO-8859-1
In section 20.8.2, the standard defines the non-callable pseudo-function
INVOKE, that takes a callable object and a list of parameters and returns
the result of calling the first argument with the rest. The reason it
wasn't an actual function is because C++03 didn't have the tools to
actually define it in all cases. I think that we do have that technology
in C++14, so I think this function should be added to the standard library.
Similarly, a function tuple_invoke, that takes a callable object and a
tuple and calls the callable object on the elements of the tuple would also
be very useful.
Joe Gottman
--
---
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_10_6413373.1374100644947
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
In section 20.8.2, the standard defines the non-callable pseudo-function IN=
VOKE, that takes a callable object and a list of parameters and returns the=
result of calling the first argument with the rest. The reason it wa=
sn't an actual function is because C++03 didn't have the tools to actually =
define it in all cases. I think that we do have that technology in C+=
+14, so I think this function should be added to the standard library.<br><=
br> Similarly, a function tuple_invoke, that takes a callable o=
bject and a tuple and calls the callable object on the elements of the tupl=
e would also be very useful.<br><br>Joe Gottman<br>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_10_6413373.1374100644947--
.
Author: Marshall Clow <mclow.lists@gmail.com>
Date: Wed, 17 Jul 2013 18:38:03 -0700
Raw View
--Apple-Mail=_75A11122-3AC3-4144-95A5-9D582BC8F220
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1
On Jul 17, 2013, at 3:37 PM, jgottman6@gmail.com wrote:
> In section 20.8.2, the standard defines the non-callable pseudo-function =
INVOKE, that takes a callable object and a list of parameters and returns t=
he result of calling the first argument with the rest. The reason it wasn'=
t an actual function is because C++03 didn't have the tools to actually def=
ine it in all cases. I think that we do have that technology in C++14, so =
I think this function should be added to the standard library.
>=20
> Similarly, a function tuple_invoke, that takes a callable object and a=
tuple and calls the callable object on the elements of the tuple would als=
o be very useful.
I think what you want was described in http://www.open-std.org/jtc1/sc22/wg=
21/docs/papers/2013/n3658.html as an example.
It's called "apply".
Alternately, if you mean "call the callable object on each element in the t=
uple, and gather the responses in a tuple" something very similar to that w=
as proposed as part of
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3404.html, but was=
not adopted by the committee (although other parts of n3404 were).
-- Marshall
Marshall Clow Idio Software <mailto:mclow.lists@gmail.com>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is prom=
ptly moderated down to (-1, Flamebait).
-- Yu Suzuki
--=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/.
--Apple-Mail=_75A11122-3AC3-4144-95A5-9D582BC8F220
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Diso-8859-1"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mo=
de: space; -webkit-line-break: after-white-space; "><div><div>On Jul 17, 20=
13, at 3:37 PM, <a href=3D"mailto:jgottman6@gmail.com">jgottman6@gmail.com<=
/a> wrote:</div><br class=3D"Apple-interchange-newline"><blockquote type=3D=
"cite">In section 20.8.2, the standard defines the non-callable pseudo-func=
tion INVOKE, that takes a callable object and a list of parameters and retu=
rns the result of calling the first argument with the rest. The reaso=
n it wasn't an actual function is because C++03 didn't have the tools to ac=
tually define it in all cases. I think that we do have that technolog=
y in C++14, so I think this function should be added to the standard librar=
y.<br><br> Similarly, a function tuple_invoke, that takes a cal=
lable object and a tuple and calls the callable object on the elements of t=
he tuple would also be very useful.<br></blockquote><div><br></div><div>I t=
hink what you want was described in <a href=3D"http://www.open-std.org=
/jtc1/sc22/wg21/docs/papers/2013/n3658.html">http://www.open-std.org/jtc1/s=
c22/wg21/docs/papers/2013/n3658.html</a> as an example.</div></div><di=
v>It's called "apply".</div><div><br></div><div>Alternately, if you mean "c=
all the callable object on each element in the tuple, and gather the respon=
ses in a tuple" something very similar to that was proposed as part of</div=
><div><a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3=
404.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3404.htm=
l</a>, but was not adopted by the committee (although other parts of n3404 =
were).</div><div><br></div><div>-- Marshall</div><div apple-content-edited=
=3D"true"><span class=3D"Apple-style-span" style=3D"border-collapse: separa=
te; border-spacing: 0px; "><br>Marshall Clow Idio Software &n=
bsp; <<a href=3D"mailto:mclow.lists@gmail.com">mailto:mclow.lists@gmail.=
com</a>><br><br>A.D. 1517: Martin Luther nails his 95 Theses to the chur=
ch door and is promptly moderated down to (-1, Flamebait).<br> =
-- Yu Suzuki</span>
</div>
<br></body></html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
--Apple-Mail=_75A11122-3AC3-4144-95A5-9D582BC8F220--
.
Author: tomaszkam@gmail.com
Date: Wed, 17 Jul 2013 21:57:33 -0700 (PDT)
Raw View
------=_Part_849_9845149.1374123453999
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I was planning to write proposal about including std::invoke function in=20
the standard after finishing my current proposal. For tuple_invoke i would=
=20
rather use std::invoke(...t...) as proposed in operator...<https://groups.g=
oogle.com/a/isocpp.org/forum/?fromgroups#!topic/std-proposals/g1HziHt1lbo>
W dniu czwartek, 18 lipca 2013 00:37:24 UTC+2 u=C5=BCytkownik jgot...@gmail=
..com=20
napisa=C5=82:
>
> In section 20.8.2, the standard defines the non-callable pseudo-function=
=20
> INVOKE, that takes a callable object and a list of parameters and returns=
=20
> the result of calling the first argument with the rest. The reason it=20
> wasn't an actual function is because C++03 didn't have the tools to=20
> actually define it in all cases. I think that we do have that technology=
=20
> in C++14, so I think this function should be added to the standard librar=
y.
>
> Similarly, a function tuple_invoke, that takes a callable object and a=
=20
> tuple and calls the callable object on the elements of the tuple would al=
so=20
> be very useful.
>
> Joe Gottman
>
--=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/.
------=_Part_849_9845149.1374123453999
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I was planning to write proposal about including std::invoke function in th=
e standard after finishing my current proposal. For tuple_invoke i would ra=
ther use std::invoke(...t...) as proposed in <a href=3D"https://groups.goog=
le.com/a/isocpp.org/forum/?fromgroups#!topic/std-proposals/g1HziHt1lbo">ope=
rator...</a><br><br>W dniu czwartek, 18 lipca 2013 00:37:24 UTC+2 u=C5=BCyt=
kownik jgot...@gmail.com napisa=C5=82:<blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left=
: 1ex;">In section 20.8.2, the standard defines the non-callable pseudo-fun=
ction INVOKE, that takes a callable object and a list of parameters and ret=
urns the result of calling the first argument with the rest. The reas=
on it wasn't an actual function is because C++03 didn't have the tools to a=
ctually define it in all cases. I think that we do have that technolo=
gy in C++14, so I think this function should be added to the standard libra=
ry.<br><br> Similarly, a function tuple_invoke, that takes a ca=
llable object and a tuple and calls the callable object on the elements of =
the tuple would also be very useful.<br><br>Joe Gottman<br></blockquote>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_849_9845149.1374123453999--
.
Author: Xeo <hivemaster@hotmail.de>
Date: Thu, 18 Jul 2013 01:09:57 -0700 (PDT)
Raw View
------=_Part_917_8302380.1374134997535
Content-Type: text/plain; charset=ISO-8859-1
`std::invoke` can already be written in C++11, it's what all library
authors have to write for `std::bind` and `std::function` anyways.
On Thursday, July 18, 2013 12:37:24 AM UTC+2, jgot...@gmail.com wrote:
>
> In section 20.8.2, the standard defines the non-callable pseudo-function
> INVOKE, that takes a callable object and a list of parameters and returns
> the result of calling the first argument with the rest. The reason it
> wasn't an actual function is because C++03 didn't have the tools to
> actually define it in all cases. I think that we do have that technology
> in C++14, so I think this function should be added to the standard library.
>
> Similarly, a function tuple_invoke, that takes a callable object and a
> tuple and calls the callable object on the elements of the tuple would also
> be very useful.
>
> Joe Gottman
>
--
---
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_917_8302380.1374134997535
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
`std::invoke` can already be written in C++11, it's what all library author=
s have to write for `std::bind` and `std::function` anyways.<br><br>On Thur=
sday, July 18, 2013 12:37:24 AM UTC+2, jgot...@gmail.com wrote:<blockquote =
class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1p=
x #ccc solid;padding-left: 1ex;">In section 20.8.2, the standard defines th=
e non-callable pseudo-function INVOKE, that takes a callable object and a l=
ist of parameters and returns the result of calling the first argument with=
the rest. The reason it wasn't an actual function is because C++03 d=
idn't have the tools to actually define it in all cases. I think that=
we do have that technology in C++14, so I think this function should be ad=
ded to the standard library.<br><br> Similarly, a function tupl=
e_invoke, that takes a callable object and a tuple and calls the callable o=
bject on the elements of the tuple would also be very useful.<br><br>Joe Go=
ttman<br></blockquote>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_917_8302380.1374134997535--
.