Topic: Extension to std::function to allow binding a
Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Mon, 27 May 2013 15:32:04 +0200
Raw View
2013/5/27 Mikhail Semenov <mikhailsemenov1957@gmail.com>:
> Is anybody interested in the following extension to std::function? I propose
> to add a constructor with
> two arguments:
>
> template<class T>
> function(T* obj1, R (T::*fx)(Arg ... ));
I like the basic idea of what you want to realize, but I don't like
the specific solution to touch std::function for this:
1) Invoking class members via the conceptual INVOKE works via
pointers, smart pointers and references. It works for pointer to data
and function members. Above signature is only a special case that
supports pointers and pointer to data members. This is unnecessarily
restricted.
2) IMO the binding of these entities should not require std::function,
the end result can be a more effective function object type (Similar
to the result of std::mem_fn) which of course *could* be wrapped
within a std::function object.
> Consider the following class:
> class A
> {
> double x;
> public:
> A(double x1):x(x1) {}
> double get() const { return x; }
> void add1(double& c) { x+= c; c = x;}
> };
>
> It will be possible to write as follows:
>
> A a(10);
>
> {
> function<void(double&)> a_add1(&a,&A::add1); // to create a delegate: to
> bind an object with its member function.
>
> double z;
> a_add1(z);
> }
>
>
> First of all, the standard function + bind will not allow to do this.
> It is also easier to use then bind (when using bind is possible); especially
> in case when function has many parameters.
>
> If the following definition is available
> template<class T, class R, class ... Arg>
> function<R(Arg ...)> member_delegate(T* obj,R (T::*f)(Arg ... ))
> {
> return function<R(Arg ...)>(obj, f);
> }
>
> then we can even write shorter:
>
> auto a_add1 = member_delegate(&a, &A::add1);
I would prefer member_delegate to return a library-specific return
type (similar to the result of bind or mem_fn), otherwise I like your
proposal.
- Daniel
--
---
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/?hl=en.
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 27 May 2013 16:32:17 +0300
Raw View
--90e6ba308f826df19304ddb32d49
Content-Type: text/plain; charset=ISO-8859-1
On 27 May 2013 16:21, Mikhail Semenov <mikhailsemenov1957@gmail.com> wrote:
> Is anybody interested in the following extension to *std::function*? I
> propose to add a constructor with
> two arguments:
>
> *template<class T>
> function(T* obj1, R (T::*fx)(Arg ... ));*
>
> Consider the following class:
> *class A
> {
> double x;
> public:
> A(double x1):x(x1) {}
> double get() const { return x; }
> void add1(double& c) { x+= c; c = x;}
> };*
>
> It will be possible to write as follows:
>
> *A a(10);*
> *{
> function<void(double&)> a_add1(&a,&A::add1); // to create a delegate:
> to bind an object with its member function.*
> *
> double z;
> a_add1(z);
> }*
>
>
> First of all, the standard function + bind will not allow to do this.
>
I don't quite grasp what you think std::function and std::bind don't allow.
--
---
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/?hl=en.
--90e6ba308f826df19304ddb32d49
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 27 May 2013 16:21, Mikhail Semenov <span dir=3D"ltr"><<a href=
=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemenov19=
57@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><p>Is anybody interested in the following ex=
tension to <b>std::function</b>? I propose to add a constructor with <br>tw=
o arguments:</p>
<p><b>template<class T><br>function(T* obj1, R (T::*fx)(Arg ... ));</=
b></p><p>Consider the following class:<br><b>class A<br>{<br>=A0=A0=A0 doub=
le x;<br>public:<br>=A0=A0=A0 A(double x1):x(x1) {}<br>=A0=A0=A0 double get=
() const { return x; }<br>
=A0=A0=A0 void add1(double& c) { x+=3D c; c =3D x;}<br>};</b></p><p>It =
will be possible to write as follows:</p><p><b>A a(10);</b></p><div><b>{<br=
>=A0=A0 function<void(double&)> a_add1(&a,&A::add1); // t=
o create a delegate: to bind an object with its member function.</b></div>
<div><b><br>=A0=A0 double z;<br>=A0=A0 a_add1(z);<br>}</b></div><p><br>Firs=
t of all, the standard function + bind will not allow to do this. <br></p><=
/blockquote><div><br></div><div>I don't quite grasp what you think std:=
:function and std::bind don't allow.<br>
<br></div></div><br></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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--90e6ba308f826df19304ddb32d49--
.
Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 27 May 2013 06:38:14 -0700 (PDT)
Raw View
------=_Part_1215_29052988.1369661894539
Content-Type: text/plain; charset=ISO-8859-1
Ville,
How can you bind a class to a member with non-value parameters, so that you
produce something similar to a_add1?
Regards,
Mikhail.
On Monday, May 27, 2013 2:32:17 PM UTC+1, Ville Voutilainen wrote:
>
>
>
> On 27 May 2013 16:21, Mikhail Semenov <mikhailse...@gmail.com<javascript:>
> > wrote:
>
>> Is anybody interested in the following extension to *std::function*? I
>> propose to add a constructor with
>> two arguments:
>>
>> *template<class T>
>> function(T* obj1, R (T::*fx)(Arg ... ));*
>>
>> Consider the following class:
>> *class A
>> {
>> double x;
>> public:
>> A(double x1):x(x1) {}
>> double get() const { return x; }
>> void add1(double& c) { x+= c; c = x;}
>> };*
>>
>> It will be possible to write as follows:
>>
>> *A a(10);*
>> *{
>> function<void(double&)> a_add1(&a,&A::add1); // to create a delegate:
>> to bind an object with its member function.*
>> *
>> double z;
>> a_add1(z);
>> }*
>>
>>
>> First of all, the standard function + bind will not allow to do this.
>>
>
> I don't quite grasp what you think std::function and std::bind don't allow.
>
>
>
--
---
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/?hl=en.
------=_Part_1215_29052988.1369661894539
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>Ville,</div><div> </div><div>How can you bind a class to a member=
with non-value parameters, so that you produce something similar to a_add1=
?</div><div> </div><div>Regards,</div><div>Mikhail.</div><div> </=
div><div> </div><div> </div><div><br>On Monday, May 27, 2013 2:32=
:17 PM UTC+1, Ville Voutilainen wrote:</div><blockquote class=3D"gmail_quot=
e" 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;"><d=
iv dir=3D"ltr"><br><div><br><br><div class=3D"gmail_quote">On 27 May 2013 1=
6:21, Mikhail Semenov <span dir=3D"ltr"><<a href=3D"javascript:" target=
=3D"_blank" gdf-obfuscated-mailto=3D"pU2tydmc24gJ">mikhailse...@gmail.com</=
a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><p>Is anybody interested in the following exte=
nsion to <b>std::function</b>? I propose to add a constructor with <br>two =
arguments:</p>
<p><b>template<class T><br>function(T* obj1, R (T::*fx)(Arg ... ));</=
b></p><p>Consider the following class:<br><b>class A<br>{<br> &n=
bsp; double x;<br>public:<br> A(double x1):x(x1) {}<br>&n=
bsp; double get() const { return x; }<br>
void add1(double& c) { x+=3D c; c =3D x;}<br>};</b><=
/p><p>It will be possible to write as follows:</p><p><b>A a(10);</b></p><di=
v><b>{<br> function<void(double&)> a_add1(&a,&=
;A::add1); // to create a delegate: to bind an object with its member funct=
ion.</b></div>
<div><b><br> double z;<br> a_add1(z);<br>}</b></div=
><p><br>First of all, the standard function + bind will not allow to do thi=
s. <br></p></blockquote><div><br></div><div>I don't quite grasp what you th=
ink std::function and std::bind don't allow.<br>
<br></div></div><br></div></div>
</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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_1215_29052988.1369661894539--
.
Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 27 May 2013 06:43:24 -0700 (PDT)
Raw View
------=_Part_2948_8964138.1369662204604
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Daniel,
=20
Another approach would be to create a class, called say *delegate*. It will=
=20
be similar to a function, but will not deal with non-standard allocators.=
=20
Basically it will allow to bind all the possible function objects as=20
std::function does (standard functions, class with operator(), lambdas) and=
=20
in addition will have two parameters for binding an object to its member.=
=20
This class will be compatible with a standard function. I have got a=20
solution for it.
=20
Mikhail.
On Monday, May 27, 2013 2:32:04 PM UTC+1, Daniel Kr=FCgler wrote:
> 2013/5/27 Mikhail Semenov <mikhailse...@gmail.com <javascript:>>:=20
> > Is anybody interested in the following extension to std::function? I=20
> propose=20
> > to add a constructor with=20
> > two arguments:=20
> >=20
> > template<class T>=20
> > function(T* obj1, R (T::*fx)(Arg ... ));=20
>
> I like the basic idea of what you want to realize, but I don't like=20
> the specific solution to touch std::function for this:=20
>
> 1) Invoking class members via the conceptual INVOKE works via=20
> pointers, smart pointers and references. It works for pointer to data=20
> and function members. Above signature is only a special case that=20
> supports pointers and pointer to data members. This is unnecessarily=20
> restricted.=20
>
> 2) IMO the binding of these entities should not require std::function,=20
> the end result can be a more effective function object type (Similar=20
> to the result of std::mem_fn) which of course *could* be wrapped=20
> within a std::function object.=20
>
> > Consider the following class:=20
> > class A=20
> > {=20
> > double x;=20
> > public:=20
> > A(double x1):x(x1) {}=20
> > double get() const { return x; }=20
> > void add1(double& c) { x+=3D c; c =3D x;}=20
> > };=20
> >=20
> > It will be possible to write as follows:=20
> >=20
> > A a(10);=20
> >=20
> > {=20
> > function<void(double&)> a_add1(&a,&A::add1); // to create a delegate=
:=20
> to=20
> > bind an object with its member function.=20
> >=20
> > double z;=20
> > a_add1(z);=20
> > }=20
> >=20
> >=20
> > First of all, the standard function + bind will not allow to do this.=
=20
> > It is also easier to use then bind (when using bind is possible);=20
> especially=20
> > in case when function has many parameters.=20
> >=20
> > If the following definition is available=20
> > template<class T, class R, class ... Arg>=20
> > function<R(Arg ...)> member_delegate(T* obj,R (T::*f)(Arg ... ))=20
> > {=20
> > return function<R(Arg ...)>(obj, f);=20
> > }=20
> >=20
> > then we can even write shorter:=20
> >=20
> > auto a_add1 =3D member_delegate(&a, &A::add1);=20
>
> I would prefer member_delegate to return a library-specific return=20
> type (similar to the result of bind or mem_fn), otherwise I like your=20
> proposal.=20
>
> - Daniel=20
>
--=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/?hl=3Den.
------=_Part_2948_8964138.1369662204604
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>Daniel,</div><div> </div><div>Another approach would be to create=
a class, called say <strong>delegate</strong>. It will be similar to a fun=
ction, but will not deal with non-standard allocators. Basically it will al=
low to bind all the possible function objects as std::function does (standa=
rd functions, class with operator(), lambdas) and in addition will have two=
parameters for binding an object to its member. This class will be compati=
ble with a standard function. I have got a solution for it.</div><div> =
;</div><div>Mikhail.</div><div><br>On Monday, May 27, 2013 2:32:04 PM UTC+1=
, Daniel Kr=FCgler wrote:</div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 20=
4, 204); border-left-width: 1px; border-left-style: solid;">2013/5/27 Mikha=
il Semenov <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mai=
lto=3D"vaK4qrIPTf8J">mikhailse...@gmail.com</a>><wbr>:
<br>> Is anybody interested in the following extension to std::function?=
I propose
<br>> to add a constructor with
<br>> two arguments:
<br>>
<br>> template<class T>
<br>> function(T* obj1, R (T::*fx)(Arg ... ));
<br>
<br>I like the basic idea of what you want to realize, but I don't like
<br>the specific solution to touch std::function for this:
<br>
<br>1) Invoking class members via the conceptual INVOKE works via
<br>pointers, smart pointers and references. It works for pointer to data
<br>and function members. Above signature is only a special case that
<br>supports pointers and pointer to data members. This is unnecessarily
<br>restricted.
<br>
<br>2) IMO the binding of these entities should not require std::function,
<br>the end result can be a more effective function object type (Similar
<br>to the result of std::mem_fn) which of course *could* be wrapped
<br>within a std::function object.
<br>
<br>> Consider the following class:
<br>> class A
<br>> {
<br>> double x;
<br>> public:
<br>> A(double x1):x(x1) {}
<br>> double get() const { return x; }
<br>> void add1(double& c) { x+=3D c; c =3D x;}
<br>> };
<br>>
<br>> It will be possible to write as follows:
<br>>
<br>> A a(10);
<br>>
<br>> {
<br>> function<void(double&)> a_add1(&a,&=
A::add1); // to create a delegate: to
<br>> bind an object with its member function.
<br>>
<br>> double z;
<br>> a_add1(z);
<br>> }
<br>>
<br>>
<br>> First of all, the standard function + bind will not allow to do th=
is.
<br>> It is also easier to use then bind (when using bind is possible); =
especially
<br>> in case when function has many parameters.
<br>>
<br>> If the following definition is available
<br>> template<class T, class R, class ... Arg>
<br>> function<R(Arg ...)> member_delegate(T* obj,R (T::*f)(Arg ..=
.. ))
<br>> {
<br>> return function<R(Arg ...)>(obj, f);
<br>> }
<br>>
<br>> then we can even write shorter:
<br>>
<br>> auto a_add1 =3D member_delegate(&a, &A::add1);
<br>
<br>I would prefer member_delegate to return a library-specific return
<br>type (similar to the result of bind or mem_fn), otherwise I like your
<br>proposal.
<br>
<br>- Daniel
<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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_2948_8964138.1369662204604--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 27 May 2013 16:45:53 +0300
Raw View
--001a11c3d7400f772604ddb35edf
Content-Type: text/plain; charset=ISO-8859-1
On 27 May 2013 16:38, Mikhail Semenov <mikhailsemenov1957@gmail.com> wrote:
> Ville,
>
> How can you bind a class to a member with non-value parameters, so that
> you produce something similar to a_add1?
>
>
>
Non-value, as in reference? I can bind the class member, the object, and
use placeholders for the rest. So I still
don't see what part function+bind doesn't solve, sorry.
--
---
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/?hl=en.
--001a11c3d7400f772604ddb35edf
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 27 May 2013 16:38, Mikhail Semenov <span dir=3D"ltr"><<a href=
=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemenov19=
57@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>Ville,</div><div>=A0</div><div>How can =
you bind a class to a member with non-value parameters, so that you produce=
something similar to a_add1?</div>
<div><br><br></div></blockquote><div><br></div><div>Non-value, as in refere=
nce? I can bind the class member, the object, and use placeholders for the =
rest. So I still<br>don't see what part function+bind doesn't solve=
, sorry.<br>
</div><div><br>=A0<br></div></div><br></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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--001a11c3d7400f772604ddb35edf--
.
Author: Martinho Fernandes <martinho.fernandes@gmail.com>
Date: Mon, 27 May 2013 15:46:08 +0200
Raw View
--047d7b6739d6ea912b04ddb35e6a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <
mikhailsemenov1957@gmail.com> wrote:
> Ville,
>
> How can you bind a class to a member with non-value parameters, so that
> you produce something similar to a_add1?
>
> Regards,
> Mikhail.
>
>
std::bind(&a, &A::add1, _1)?
Mit freundlichen Gr=FC=DFen,
Martinho
--=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/?hl=3Den.
--047d7b6739d6ea912b04ddb35e6a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, May 27, 2013 at 3:38 PM, Mikhail Semenov <span dir=3D"ltr"><<a href=
=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemenov19=
57@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div>Ville,</div><div>=A0=
</div><div>How can you bind a class to a member with non-value parameters, =
so that you produce something similar to a_add1?</div>
<div>=A0</div><div>Regards,</div><div>Mikhail.<br><br></div></blockquote><d=
iv><br>std::bind(&a, &A::add1, _1)?</div><div><br clear=3D"all"><di=
v>Mit freundlichen Gr=FC=DFen,<br><br>Martinho</div>=A0
<br></div></div><br></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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--047d7b6739d6ea912b04ddb35e6a--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 27 May 2013 16:46:26 +0300
Raw View
--f46d04446a930385f804ddb36032
Content-Type: text/plain; charset=ISO-8859-1
On 27 May 2013 16:45, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
>
>
>
> On 27 May 2013 16:38, Mikhail Semenov <mikhailsemenov1957@gmail.com>wrote:
>
>> Ville,
>>
>> How can you bind a class to a member with non-value parameters, so that
>> you produce something similar to a_add1?
>>
>>
>>
> Non-value, as in reference? I can bind the class member, the object, and
> use placeholders for the rest. So I still
> don't see what part function+bind doesn't solve, sorry.
>
>
>
>
The bit above should say "class member function", not "class member".
--
---
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/?hl=en.
--f46d04446a930385f804ddb36032
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 27 May 2013 16:45, Ville Voutilainen <span dir=3D"ltr"><<a hr=
ef=3D"mailto:ville.voutilainen@gmail.com" target=3D"_blank">ville.voutilain=
en@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div class=3D"gmail_ext=
ra"><br><br><div class=3D"gmail_quote"><div class=3D"im">On 27 May 2013 16:=
38, Mikhail Semenov <span dir=3D"ltr"><<a href=3D"mailto:mikhailsemenov1=
957@gmail.com" target=3D"_blank">mikhailsemenov1957@gmail.com</a>></span=
> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>Ville,</div><div>=A0</div><div>How can =
you bind a class to a member with non-value parameters, so that you produce=
something similar to a_add1?</div>
<div><br><br></div></blockquote><div><br></div></div><div>Non-value, as in =
reference? I can bind the class member, the object, and use placeholders fo=
r the rest. So I still<br>don't see what part function+bind doesn't=
solve, sorry.<br>
</div><div><br>=A0<br></div></div><br></div></div>
</blockquote></div><br></div><div class=3D"gmail_extra">The bit above shoul=
d say "class member function", not "class member".<br><=
/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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--f46d04446a930385f804ddb36032--
.
Author: Martinho Fernandes <martinho.fernandes@gmail.com>
Date: Mon, 27 May 2013 15:46:45 +0200
Raw View
--047d7bd6acf42a0de304ddb361b0
Content-Type: text/plain; charset=ISO-8859-1
On Mon, May 27, 2013 at 3:46 PM, Martinho Fernandes <
martinho.fernandes@gmail.com> wrote:
> On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <
> mikhailsemenov1957@gmail.com> wrote:
>
>> Ville,
>>
>> How can you bind a class to a member with non-value parameters, so that
>> you produce something similar to a_add1?
>>
>> Regards,
>> Mikhail.
>>
>>
> std::bind(&a, &A::add1, _1)?
>
>
> Ooops, std::bind(&A::add1, &a, _1)?
--
---
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/?hl=en.
--047d7bd6acf42a0de304ddb361b0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Mon, May 27, 2013 at 3:46 PM, Martinho Fernandes <span =
dir=3D"ltr"><<a href=3D"mailto:martinho.fernandes@gmail.com" target=3D"_=
blank">martinho.fernandes@gmail.com</a>></span> wrote:<br><div class=3D"=
gmail_extra">
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
"><div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote"><d=
iv class=3D"im">
On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <span dir=3D"ltr"><<a h=
ref=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemeno=
v1957@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div>Ville,</div><div>=A0=
</div><div>How can you bind a class to a member with non-value parameters, =
so that you produce something similar to a_add1?</div>
<div>=A0</div><div>Regards,</div><div>Mikhail.<br><br></div></blockquote></=
div><div><br>std::bind(&a, &A::add1, _1)?</div><div><br><br></div><=
/div></div></div></blockquote><div>Ooops, std::bind(&A::add1, &a, _=
1)? <br>
</div></div><br></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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--047d7bd6acf42a0de304ddb361b0--
.
Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 27 May 2013 06:54:13 -0700 (PDT)
Raw View
------=_Part_66_21157096.1369662853402
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
This will not work for a reference parameter.
=20
On Monday, May 27, 2013 2:46:08 PM UTC+1, R. Martinho Fernandes wrote:
> On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <mikhailse...@gmail.com<=
javascript:>
> > wrote:
>
>> Ville,
>> =20
>> How can you bind a class to a member with non-value parameters, so that=
=20
>> you produce something similar to a_add1?
>> =20
>> Regards,
>> Mikhail.
>>
>>
> std::bind(&a, &A::add1, _1)?
>
> Mit freundlichen Gr=FC=DFen,
>
> Martinho
> =20
>
>
--=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/?hl=3Den.
------=_Part_66_21157096.1369662853402
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>This will not work for a reference parameter.</div><div> </div><d=
iv><br>On Monday, May 27, 2013 2:46:08 PM UTC+1, R. Martinho Fernandes wrot=
e:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8e=
x; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-wi=
dth: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><div class=3D"gm=
ail_quote">On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <span dir=3D"lt=
r"><<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"f=
lDdzC790K4J">mikhailse...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div>Ville,</div><div> </div><div>How can=
you bind a class to a member with non-value parameters, so that you produc=
e something similar to a_add1?</div>
<div> </div><div>Regards,</div><div>Mikhail.<br><br></div></blockquote=
><div><br>std::bind(&a, &A::add1, _1)?</div><div><br clear=3D"all">=
<div>Mit freundlichen Gr=FC=DFen,<br><br>Martinho</div>
<br></div></div><br></div></div>
</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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_66_21157096.1369662853402--
.
Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 27 May 2013 06:55:59 -0700 (PDT)
Raw View
------=_Part_32_32307799.1369662959642
Content-Type: text/plain; charset=ISO-8859-1
The point is to treat object+member as an ordinary function, no matter what
the parameters are.
On Monday, May 27, 2013 2:45:53 PM UTC+1, Ville Voutilainen wrote:
>
>
>
> On 27 May 2013 16:38, Mikhail Semenov <mikhailse...@gmail.com<javascript:>
> > wrote:
>
>> Ville,
>>
>> How can you bind a class to a member with non-value parameters, so that
>> you produce something similar to a_add1?
>>
>>
>>
> Non-value, as in reference? I can bind the class member, the object, and
> use placeholders for the rest. So I still
> don't see what part function+bind doesn't solve, sorry.
>
>
>
>
--
---
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/?hl=en.
------=_Part_32_32307799.1369662959642
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>The point is to treat object+member as an ordinary function, no matter=
what the parameters are. </div><div> </div><div><br>On Monday, May 27=
, 2013 2:45:53 PM UTC+1, Ville Voutilainen wrote:</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-width: 1px; border-left-style:=
solid;"><div dir=3D"ltr"><br><div><br><br><div class=3D"gmail_quote">On 27=
May 2013 16:38, Mikhail Semenov <span dir=3D"ltr"><<a href=3D"javascrip=
t:" target=3D"_blank" gdf-obfuscated-mailto=3D"407jVv4C2-cJ">mikhailse...@g=
mail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div>Ville,</div><div> </div><div>How can=
you bind a class to a member with non-value parameters, so that you produc=
e something similar to a_add1?</div>
<div><br><br></div></blockquote><div><br></div><div>Non-value, as in refere=
nce? I can bind the class member, the object, and use placeholders for the =
rest. So I still<br>don't see what part function+bind doesn't solve, sorry.=
<br>
</div><div><br> <br></div></div><br></div></div>
</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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_32_32307799.1369662959642--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 27 May 2013 16:56:19 +0300
Raw View
--001a11c3d740597e8704ddb38315
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On 27 May 2013 16:54, Mikhail Semenov <mikhailsemenov1957@gmail.com> wrote:
> This will not work for a reference parameter.
>
It works on gcc 4.7 and clang 3.4 in practice. What makes you think it
doesn't work?
>
>
> On Monday, May 27, 2013 2:46:08 PM UTC+1, R. Martinho Fernandes wrote:
>
>> On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <mikhailse...@gmail.com=
>wrote:
>>
>>> Ville,
>>>
>>> How can you bind a class to a member with non-value parameters, so that
>>> you produce something similar to a_add1?
>>>
>>> Regards,
>>> Mikhail.
>>>
>>>
>> std::bind(&a, &A::add1, _1)?
>>
>> Mit freundlichen Gr=FC=DFen,
>>
>> Martinho
>>
>>
>> --
>
> ---
> 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/?hl=3Den.
>
>
>
--=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/?hl=3Den.
--001a11c3d740597e8704ddb38315
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 27 May 2013 16:54, Mikhail Semenov <span dir=3D"ltr"><<a href=
=3D"mailto:mikhailsemenov1957@gmail.com" target=3D"_blank">mikhailsemenov19=
57@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>This will not work for a reference para=
meter.</div></blockquote><div><br></div><div>It works on gcc 4.7 and clang =
3.4 in practice. What makes you think it doesn't work?<br>
=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div>=A0</div><div><br>On Monda=
y, May 27, 2013 2:46:08 PM UTC+1, R. Martinho Fernandes wrote:</div><div cl=
ass=3D"HOEnZb">
<div class=3D"h5"><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 dir=3D"ltr"><div><div class=3D"gmai=
l_quote">
On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <span dir=3D"ltr"><<a>m=
ikhailse...@gmail.com</a>></span> wrote:<br>
<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-l=
eft-style:solid"><div>Ville,</div><div>=A0</div><div>How can you bind a cla=
ss to a member with non-value parameters, so that you produce something sim=
ilar to a_add1?</div>
<div>=A0</div><div>Regards,</div><div>Mikhail.<br><br></div></blockquote><d=
iv><br>std::bind(&a, &A::add1, _1)?</div><div><br clear=3D"all"><di=
v>Mit freundlichen Gr=FC=DFen,<br><br>Martinho</div>=A0
<br></div></div><br></div></div>
</blockquote>
<p></p>
-- <br>
=A0<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 <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/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</div></div></blockquote></div><br></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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--001a11c3d740597e8704ddb38315--
.
Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 27 May 2013 09:20:16 -0700 (PDT)
Raw View
------=_Part_231_773066.1369671616662
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
My mistake!
On Monday, May 27, 2013 2:56:19 PM UTC+1, Ville Voutilainen wrote:
>
>
>
> On 27 May 2013 16:54, Mikhail Semenov <mikhailse...@gmail.com<javascript:=
>
> > wrote:
>
>> This will not work for a reference parameter.
>>
>
> It works on gcc 4.7 and clang 3.4 in practice. What makes you think it=20
> doesn't work?
> =20
>
>> =20
>>
>> On Monday, May 27, 2013 2:46:08 PM UTC+1, R. Martinho Fernandes wrote:
>>
>>> On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <mikhailse...@gmail.co=
m
>>> > wrote:
>>>
>>>> Ville,
>>>> =20
>>>> How can you bind a class to a member with non-value parameters, so tha=
t=20
>>>> you produce something similar to a_add1?
>>>> =20
>>>> Regards,
>>>> Mikhail.
>>>>
>>>>
>>> std::bind(&a, &A::add1, _1)?
>>>
>>> Mit freundlichen Gr=FC=DFen,
>>>
>>> Martinho
>>> =20
>>>
>>> --=20
>> =20
>> ---=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=3Den.
>> =20
>> =20
>>
>
>
--=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/?hl=3Den.
------=_Part_231_773066.1369671616662
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>My mistake!</div><div><br>On Monday, May 27, 2013 2:56:19 PM UTC+1, Vi=
lle Voutilainen wrote:</div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 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"><=
br><div><br><br><div class=3D"gmail_quote">On 27 May 2013 16:54, Mikhail Se=
menov <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-o=
bfuscated-mailto=3D"ez1Z_RQByBAJ">mikhailse...@gmail.com</a>></span> wro=
te:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div>This will not work for a reference parame=
ter.</div></blockquote><div><br></div><div>It works on gcc 4.7 and clang 3.=
4 in practice. What makes you think it doesn't work?<br>
<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-width: 1px; border-left-style: solid;"><div> </div><div><br>On M=
onday, May 27, 2013 2:46:08 PM UTC+1, R. Martinho Fernandes wrote:</div><di=
v>
<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-width=
: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><div class=3D"gmail=
_quote">
On Mon, May 27, 2013 at 3:38 PM, Mikhail Semenov <span dir=3D"ltr"><<a>m=
ikhailse...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div>Ville,</div><div> </div><div>How can=
you bind a class to a member with non-value parameters, so that you produc=
e something similar to a_add1?</div>
<div> </div><div>Regards,</div><div>Mikhail.<br><br></div></blockquote=
><div><br>std::bind(&a, &A::add1, _1)?</div><div><br clear=3D"all">=
<div>Mit freundlichen Gr=FC=DFen,<br><br>Martinho</div>
<br></div></div><br></div></div>
</blockquote>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
ez1Z_RQByBAJ">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"ez1Z_RQByBAJ">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/<wbr>i=
socpp.org/group/std-<wbr>proposals/?hl=3Den</a>.<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>
</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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_231_773066.1369671616662--
.
Author: Jonathan Wakely <cxx@kayari.org>
Date: Tue, 28 May 2013 05:09:06 -0700 (PDT)
Raw View
------=_Part_3915_5041585.1369742946289
Content-Type: text/plain; charset=ISO-8859-1
On Monday, May 27, 2013 2:32:17 PM UTC+1, Ville Voutilainen wrote:
>
>
>> First of all, the standard function + bind will not allow to do this.
>>
>
> I don't quite grasp what you think std::function and std::bind don't allow.
>
This proposal would allow you to refer to an overloaded member function
without an explicit cast or other means to specify the desired overload,
e.g.
struct A
{
void f();
int f(int);
} a;
std::function<void()> f1(&a, &A::f); // chooses first overload
That's quite convenient. However it isn't as flexible: std::function
allows implicit conversions on the return type and arguments, but using
this proposal you'd have to be precise, e.g.
std::function<void(int)> f2(&a, &A::f); // error
std::function<short(short)> f3(&a, &A::f); // error
Both of those will work using std::bind (and a cast to select the
overload), but with this proposal you'd have to do:
std::function<void(int)> f2 = std::function<int(int)>(&a, &A::f);
std::function<short(short)> f3 = std::function<int(int)>(&a, &A::f);
--
---
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/?hl=en.
------=_Part_3915_5041585.1369742946289
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Monday, May 27, 2013 2:32:17 PM UTC+1, Ville Voutilainen wrote:<=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><div clas=
s=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><p><br>First of all, the s=
tandard function + bind will not allow to do this. <br></p></blockquote><di=
v><br></div><div>I don't quite grasp what you think std::function and std::=
bind don't allow.<br></div></div></div></div></blockquote><div><br>This pro=
posal would allow you to refer to an overloaded member function without an =
explicit cast or other means to specify the desired overload, e.g.<br><br>s=
truct A<br>{<br> void f();<br> int f(int);<br>} a;<br><br>std::=
function<void()> f1(&a, &A::f); // chooses first overlo=
ad<br><br>That's quite convenient. However it isn't as flexible: std:=
:function allows implicit conversions on the return type and arguments, but=
using this proposal you'd have to be precise, e.g.<br><br>std::function<=
;void(int)> f2(&a, &A::f); // error<br>std::function<sh=
ort(short)> f3(&a, &A::f); // error<br><br>Both of those w=
ill work using std::bind (and a cast to select the overload), but with this=
proposal you'd have to do:<br><br>std::function<void(int)> f2 =3D st=
d::function<int(int)>(&a, &A::f);<br>std::function<short(s=
hort)> f3 =3D std::function<int(int)>(&a, &A::f);<br><br>&=
nbsp;<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" 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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_3915_5041585.1369742946289--
.