|
Boost : |
From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-01-31 11:30:59
On Thursday 31 January 2002 11:09 am, you wrote:
> There is nothing wrong with the compiler; the problem is caused by
> boost::function<void, ...>'s void return workaround. It substitutes void
> with boost::detail::function::unusable.
>
> If you use bind(single_arg_func, 13), without the '<void>', it will work
> (on partial-* compilers.) If you want to use the explicit syntax, the
> correct return type is 'boost::detail::function::unusable'.
So bind won't swallow return values? I think that an expression like:
bind<T>(single_arg_func, 13)
should say "I want a return value of type T", not "single_arg_func has a
return value of type T". Note that the former is the case for T != void,
because bind will perform an implicit conversion from signal_arg_func's
return type to T when it returns. When T == void, however, the return type of
the bound function object is required to be exactly void -- this seems
inconsistent to me.
Function is also to blame here, because function<void, ...> really shouldn't
be returning something other than void. I'm going to go try out some
workarounds...
Doug
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk