Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-09 14:16:43


From: "Duane Murphy" <duanemurphy_at_[hidden]>
> I am trying to use bind() with std::not1() (I think this is what I want
> to do :-). But std::not1() gets a compiler error because bind doesnt have
> an argument_type typedef.
>
> bool is_something( int x, int y )
> {
> return something( x, y );
> }
>
> {
> ...
> if ( std::not1( boost::bind( is_something, 3, _1 ) ) )
> {
> // not something
> }
> }
>
> Am I approaching this incorrectly? Does bind support argument_type?

No, bind does not support argument_type. You can pass anything to
bind(is_something, 3, _1) and bind will forward it to is_something; it
doesn't have a fixed argument type.

You can use

bind(logical_not<bool>(), bind(is_something, 3, _1))

although I admit that it's not as concise as the not1 version.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net