...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::type_erasure::callable
// In header: <boost/type_erasure/callable.hpp> template<typename Sig, typename F = _self> struct callable { // public static functions static R apply(F &, T...); };
The callable concept allows an any to hold function objects. Sig
is interpreted in the same way as for Boost.Function, except that the arguments and return type are allowed to be placeholders. F
must be a placeholder.
Multiple instances of callable can be used simultaneously. Overload resolution works normally. Note that unlike Boost.Function, callable does not provide result_type. It does, however, support boost::result_of
.