Boost logo

Boost Users :

Subject: Re: [Boost-users] [traits/function_types/generic] Can F be called with{a0, ..., aN}?
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2010-03-03 10:42:29


Rutger ter Borg <rutger <at> terborg.net> writes:
> is_callable< BOOST_TYPEOF( boost::bind( &some_f, _1 ) ),
> boost::mpl::vector< std::string > > is true_.

Yup. The other problem I found was that it couldn't successfully detect if the
'arity mismatched and return false.
You can see my test cases with my old implementation in:
http://svn.econtoolkit.com/libraries/trunk/etk/tests/meta/test_function_traits.cpp

I put in comments for the static asserts that didn't work.
See the "test_unary_function_compatibility" in particular.

> I see. I will check if this indirection can be detected somewhere...

I was mainly using std::tr1::bind here rather than boost bind, but since people
keep telling me to move to phoenix rather than boost::bind and boost::lambda
I was mainly worried about those cases.

I also found that boost::lambda wouldn't even compile with the "trick" which is
why I ended up returning true_ for now.


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