![]() |
Home | Libraries | People | FAQ | More |
boost::make_overloaded_function — Make an overloaded function object without explicitly specifying the function types.
// In header: <boost/functional/overloaded_function.hpp> template<typename F1, typename F2, ... > overloaded_function< __function_type__< F1 >, __function_type__< F2 >,...> make_overloaded_function(F1 f1, F2 f2, ...);
This function template creates and returns an object that overloads all the specified functions overloaded_functionf1, f2, etc.
The function types are internally determined from the template parameter types so they do not need to be explicitly specified. Therefore, this function template usually has a more concise syntax when compared with . This is especially useful when the explicit type of the returned overloaded_function object does not need to be known (e.g., when used with Boost.Typeof's overloaded_functionBOOST_AUTO, C++11 auto, or when the overloaded function object is handled using a function template parameter, see the Tutorial section).
The maximum number of functions to overload is given by the configuration macro.BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
Note: In this documentation, __function_type__ is a placeholder for a symbol that is specific to the implementation of this library.
See: Tutorial section, , overloaded_function. BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX