Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

std::tr1::bind operators

36 views
Skip to first unread message

Nikola Smiljanić

unread,
Jul 18, 2009, 10:51:22 PM7/18/09
to
I know that boost::bind function objects overload the logical not
operator ! and the relational and logical operators ==, !=, <, <=, >,
>=, &&, ||.

But I can't find anything about this in TR1, the only page talking
about bind is 25 (section 3.6.3). Was this removed from TR1?

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Mathias Gaunard

unread,
Jul 20, 2009, 5:24:13 AM7/20/09
to
On 19 juil, 04:51, Nikola Smiljaniďż˝ <popiz...@gmail.com> wrote:
> I know that boost::bind function objects overload the logical not
> operator ! and the relational and logical operators ==, !=, <, <=, >,
>
> >=, &&, ||.

You must be confusing boost::bind with boost::lambda.
Moreover, what do you mean by "boost::bind function objects"? Function
objects returned by boost::bind?

SG

unread,
Jul 20, 2009, 7:12:09 PM7/20/09
to
On 20 Jul., 11:24, Mathias Gaunard <loufo...@gmail.com> wrote:

> On 19 juil, 04:51, Nikola Smiljani� <popiz...@gmail.com> wrote:
>
> > I know that boost::bind function objects overload the logical not
> > operator ! and the relational and logical operators ==, !=, <, <=, >,
>
> > >=, &&, ||.
>
> You must be confusing boost::bind with boost::lambda.
> Moreover, what do you mean by "boost::bind function objects"? Function
> objects returned by boost::bind?

See "Overloaded operators (new in Boost 1.33)"
http://www.boost.org/doc/libs/1_39_0/libs/bind/bind.html#operators

Cheers!
SG

Nikola Smiljanić

unread,
Jul 20, 2009, 8:54:51 PM7/20/09
to
> You must be confusing boost::bind with boost::lambda.
> Moreover, what do you mean by "boost::bind function objects"? Function
> objects returned by boost::bind?

Yes, function objects return by boost::bind have these operators, so
you can write find_if(v.begin(), v.end(), boost::bind(&MyClass::count,
_1) == 5) and I can't find anything about this in TR1.

Mathias Gaunard

unread,
Jul 21, 2009, 5:51:19 AM7/21/09
to
On 21 juil, 01:12, SG <s.gesem...@gmail.com> wrote:

> See "Overloaded operators (new in Boost 1.33)"http://www.boost.org/doc/libs/1_39_0/libs/bind/bind.html#operators

My bad, never saw that (for my defense I would say the documentation
isn't very well made, it's not mentioned in the more formal definition
of the properties of the return type of bind).

Peter Dimov

unread,
Jul 21, 2009, 1:17:08 PM7/21/09
to
On Jul 19, 5:51 am, Nikola Smiljaniďż˝ <popiz...@gmail.com> wrote:
> I know that boost::bind function objects overload the logical not
> operator ! and the relational and logical operators ==, !=, <, <=, >,
>
> >=, &&, ||.
>
> But I can't find anything about this in TR1, the only page talking
> about bind is 25 (section 3.6.3). Was this removed from TR1?

The operators were not part of the TR1 proposal. They were added to
boost::bind after TR1 was finalized.

0 new messages