Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-06-02 12:37:40


AMDG

Olaf Krzikalla wrote:
> Steven Watanabe wrote:
>
>> Boost.Function doesn't provide such a utility. I can't see a way to
>> get this information out of boost::bind using the public interface, either.
>> visit_each skips placeholders.
>>
> IMHO it should be a feature of boost::function.
>

I strongly disagree.

a) It requires Boost.Function to treat function object created by
Boost.Bind specially.
b) Most people don't need it and it will add overhead even when it isn't
used.

>> uses_placeholder2(false), f(t) {
>> // do some magic to find which arguments are used.
>> }
>>
> But what is the magic here?
>

It would have to peek at the Boost.Bind internals, I think.

> I'm aware that the implementation won't be that easy, esp. the static
> computing of the type of fn_result could become difficult.
>

You would need to specify fn_result as a top level template parameter.
Also, there are serious problems with the multiple dispatching required to
do the binding.

In Christ,
Steven Watanabe


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