Boost logo

Boost :

From: Marco (mrcekets_at_[hidden])
Date: 2007-10-07 08:11:13


On Sun, 07 Oct 2007 10:41:52 +0200, Marco Costalba <mcostalba_at_[hidden]>
wrote:

>
> I would think to fix completely the problem reported by Joel we could
> write instead:
>
> boost::is_convertible<F, boost::function<T> >
>
> But for unknown reasons this fails! All types of function pointers match!
>
> Could someone please be so kind to enlight me?
>
> Thanks
> Marco

Because boost::function has a constructor whose behavior is like this:

template< typename Functor >
function (Functor const& f)

it skips only integral type through enable_if.

So, except integral, everything is convertible to boost::function even
apples.

In order to implement signature deduction I exploits a support utility
used in the implementation of boost::function and a lot of metaprogramming.
Give a glance to detail::function::get_function_tag in function_base.hpp,
in order to learn how to discern between different kind of functors.

Regard,
Marco Cecchetti

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk