Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-09-02 06:21:47


Matt S Trentini <matt_trentini_at_[hidden]> writes:

> Heya Boosters,
>
> I ran into a problem using boost::bind yesterday and, although I found
> a workaround, I've got a few questions. For the record I'm using
> boost 1.30.
>
> I stumbled onto the issue that boost::bind doesn't define the
> argument_type typedef (I was trying to use std::not1). After trawling
> the web I found a discussion, and useful workaround, about this here:
>
> http://tinyurl.com/5bl9m
>
> Questions that arose from this:
>
> o Why doesn't boost::bind support argument_type?

Because it doesn't know what you will pass to it ;-)

Consider:

        struct polymorphic_function_object
        {
            template <class T>
            T operator()(T x) const;
        };

What should argument_type be in the result of

     bind(polymorphic_function_object(), _1)

??

> o What other standard library function adapters does this affect?
> - Is it all that are derived from unary_function?

Any that require an argument_type typedef, I suppose.

> o Has the operator! addition been incorporated into later versions
> of boost?
> - If not, why not?

Have you looked at the Boost lambda library? It incorporates all the
operators.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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