<?xml version="1.0" standalone="yes"?>
<library-reference id="reference"><title>Reference</title><header id="doxygen.reference.overloaded__function_8hpp" name="boost/functional/overloaded_function.hpp">
<para>Overload distinct function pointers, function references, and monomorphic function objects into a single function object. </para><namespace name="boost">
<class id="doxygen.reference.classboost_1_1overloaded__function" name="overloaded_function"><template>
      <template-type-parameter name="F1"/>
      <template-type-parameter name="F2"/>
      <template-nontype-parameter name=""><type>...</type></template-nontype-parameter>
    </template><purpose>Function object to overload functions with distinct signatures. </purpose><description><para>This function object aggregates together calls to functions of all the specified function types <computeroutput>F1</computeroutput>, <computeroutput>F2</computeroutput>, etc which must have distinct function signatures from one another.</para><para><emphasis role="bold">Parameters:</emphasis> <informaltable><tgroup cols="2"><tbody><row>
<entry><emphasis role="bold"><computeroutput>F<emphasis>i</emphasis></computeroutput></emphasis></entry><entry>Each function type must be specified using the following syntax (which is Boost.Function's preferred syntax): <programlisting language="c++">result_type (argument1_type, argumgnet2_type, ...)
</programlisting> </entry></row>
</tbody></tgroup></informaltable>
</para><para>In some cases, the  <computeroutput><functionname alt="make_overloaded_function">make_overloaded_function</functionname></computeroutput> function template can be useful to construct an overloaded function object without explicitly specifying the function types.</para><para>At least two distinct function types must be specified (because there is nothing to overload between one or zero functions). The maximum number of functions to overload is given by the  <computeroutput><macroname alt="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</macroname></computeroutput> configuration macro. The maximum number of function parameters for each of the specified function types is given by the  <computeroutput><macroname alt="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</macroname></computeroutput> configuration macro.</para><para><emphasis role="bold">See:</emphasis>  <link linkend="boost_functional_overloadedfunction.tutorial"> Tutorial</link> section,  <computeroutput><functionname alt="make_overloaded_function">make_overloaded_function</functionname></computeroutput>,  <computeroutput><macroname alt="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</macroname></computeroutput>,  <computeroutput><macroname alt="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX</macroname></computeroutput>, Boost.Function. </para></description><method-group name="public member functions">
<constructor id="doxygen.reference.classboost_1_1overloaded__function_1a8149bd1d11e2798aaec6d85f69c833e7"><parameter name=""><paramtype>const boost::function&lt; F1 &gt; &amp;</paramtype></parameter><parameter name=""><paramtype>const boost::function&lt; F2 &gt; &amp;</paramtype></parameter><parameter name=""><paramtype>...</paramtype></parameter><purpose>Construct the overloaded function object. </purpose><description><para>Any function pointer, function reference, and monomorphic function object that can be converted to a <computeroutput>boost::function</computeroutput> function object can be specified as parameter.</para><para><emphasis role="bold">Note:</emphasis> Unfortunately, it is not possible to support polymorphic function objects (as explained <ulink url="http://lists.boost.org/Archives/boost/2012/03/191744.php">here</ulink>). </para></description></constructor>
<method id="doxygen.reference.classboost_1_1overloaded__function_1a63cdddddaf1c62879393c33d35e7bc78" name="operator()" cv="const"><type>boost::function_traits&lt; F1 &gt;::result_type</type><parameter name=""><paramtype>typename boost::function_traits&lt; F1 &gt;::arg1_type</paramtype></parameter><parameter name=""><paramtype>typename boost::function_traits&lt; F1 &gt;::arg2_type</paramtype></parameter><parameter name=""><paramtype>...</paramtype></parameter><purpose>Call operator matching the signature of the function type specified as 1st template parameter. </purpose><description><para>This will in turn invoke the call operator of the 1st function passed to the constructor. </para></description></method>
<method id="doxygen.reference.classboost_1_1overloaded__function_1aacef9395e87aab8e32e3ba22ad44a155" name="operator()" cv="const"><type>boost::function_traits&lt; F2 &gt;::result_type</type><parameter name=""><paramtype>typename boost::function_traits&lt; F2 &gt;::arg1_type</paramtype></parameter><parameter name=""><paramtype>typename boost::function_traits&lt; F2 &gt;::arg2_type</paramtype></parameter><parameter name=""><paramtype>...</paramtype></parameter><purpose>Call operator matching the signature of the function type specified as 2nd template parameter. </purpose><description><para>This will in turn invoke the call operator of the 2nd function passed to the constructor.</para><para><emphasis role="bold">Note:</emphasis> Similar call operators are present for all specified function types <computeroutput>F1</computeroutput>, <computeroutput>F2</computeroutput>, etc (even if not exhaustively listed by this documentation). </para></description></method>
</method-group>
</class><function id="doxygen.reference.overloaded__function_8hpp_1a5171794e76c751a328e2e85017673b60" name="make_overloaded_function"><type><classname>overloaded_function</classname>&lt; __function_type__&lt; F1 &gt;, __function_type__&lt; F2 &gt;,... &gt;</type><template>
          <template-type-parameter name="F1"/>
          <template-type-parameter name="F2"/>
          <template-nontype-parameter name=""><type>...</type></template-nontype-parameter>
        </template><parameter name="f1"><paramtype>F1</paramtype></parameter><parameter name="f2"><paramtype>F2</paramtype></parameter><parameter name=""><paramtype>...</paramtype></parameter><purpose>Make an overloaded function object without explicitly specifying the function types. </purpose><description><para>This function template creates and returns an  <computeroutput><classname alt="overloaded_function">overloaded_function</classname></computeroutput> object that overloads all the specified functions <computeroutput>f1</computeroutput>, <computeroutput>f2</computeroutput>, etc.</para><para>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  <computeroutput><classname alt="overloaded_function">overloaded_function</classname></computeroutput>. This is especially useful when the explicit type of the returned  <computeroutput><classname alt="overloaded_function">overloaded_function</classname></computeroutput> object does not need to be known (e.g., when used with Boost.Typeof's <computeroutput>BOOST_AUTO</computeroutput>, C++11 <computeroutput>auto</computeroutput>, or when the overloaded function object is handled using a function template parameter, see the  <link linkend="boost_functional_overloadedfunction.tutorial"> Tutorial</link> section).</para><para>The maximum number of functions to overload is given by the  <computeroutput><macroname alt="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</macroname></computeroutput> configuration macro.</para><para><emphasis role="bold">Note:</emphasis> In this documentation, <computeroutput><emphasis role="bold">function_type</emphasis></computeroutput> is a placeholder for a symbol that is specific to the implementation of this library.</para><para><emphasis role="bold">See:</emphasis>  <link linkend="boost_functional_overloadedfunction.tutorial"> Tutorial</link> section,  <computeroutput><classname alt="overloaded_function">overloaded_function</classname></computeroutput>,  <computeroutput><macroname alt="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX</macroname></computeroutput>. </para></description></function>
</namespace>
</header>
<header id="doxygen.reference.config_8hpp" name="boost/functional/overloaded_function/config.hpp">
<para>Change the compile-time configuration of this library. </para><macro id="doxygen.reference.config_8hpp_1a6150439db31104237467d86322c78939" name="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX"><purpose>Specify the maximum number of arguments of the functions being overloaded. </purpose><description><para>If this macro is left undefined by the user, it has a default value of 5 (increasing this number might increase compilation time). When specified by the user, this macro must be a non-negative integer number.</para><para><emphasis role="bold">See:</emphasis>  <link linkend="boost_functional_overloadedfunction.getting_started"> Getting Started</link>,  <computeroutput><classname alt="boost::overloaded_function">boost::overloaded_function</classname></computeroutput>. </para></description></macro>
<macro id="doxygen.reference.config_8hpp_1ac0a7c048bf915c9642a1566401d32a00" name="BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX"><purpose>Specify the maximum number of functions that can be overloaded. </purpose><description><para>If this macro is left undefined by the user, it has a default value of 5 (increasing this number might increase compilation time). When defined by the user, this macro must be an integer number greater or equal than 2 (because at least two distinct functions need to be specified in order to define an overload).</para><para><emphasis role="bold">See:</emphasis>  <link linkend="boost_functional_overloadedfunction.getting_started"> Getting Started</link>,  <computeroutput><classname alt="boost::overloaded_function">boost::overloaded_function</classname></computeroutput>. </para></description></macro>
</header>
</library-reference>