3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Function template make_overloaded_function
</title>
5 <link rel=
"stylesheet" href=
"../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.76.1">
7 <link rel=
"home" href=
"../index.html" title=
"Chapter 1. Boost.Functional/OverloadedFunction 1.0.0">
8 <link rel=
"up" href=
"../reference.html#header.boost.functional.overloaded_function_hpp" title=
"Header <boost/functional/overloaded_function.hpp>">
9 <link rel=
"prev" href=
"overloaded_function.html" title=
"Class template overloaded_function">
10 <link rel=
"next" href=
"../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html" title=
"Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../../libs/libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"overloaded_function.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../reference.html#header.boost.functional.overloaded_function_hpp"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
25 <div class=
"refentry">
26 <a name=
"boost.make_overloaded_function"></a><div class=
"titlepage"></div>
27 <div class=
"refnamediv">
28 <h2><span class=
"refentrytitle">Function template make_overloaded_function
</span></h2>
29 <p>boost::make_overloaded_function
— Make an overloaded function object without explicitly specifying the function types.
</p>
31 <h2 xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class=
"refsynopsisdiv-title">Synopsis
</h2>
32 <div xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class=
"refsynopsisdiv"><pre class=
"synopsis"><span class=
"comment">// In header:
<<a class=
"link" href=
"../reference.html#header.boost.functional.overloaded_function_hpp" title=
"Header <boost/functional/overloaded_function.hpp>">boost/functional/overloaded_function.hpp
</a>>
35 <span class=
"keyword">template
</span><span class=
"special"><</span><span class=
"keyword">typename
</span> F1
<span class=
"special">,
</span> <span class=
"keyword">typename
</span> F2
<span class=
"special">,
</span> <span class=
"special">...
</span> <span class=
"special">></span>
36 <a class=
"link" href=
"overloaded_function.html" title=
"Class template overloaded_function">overloaded_function
</a><span class=
"special"><</span> <span class=
"identifier">__function_type__
</span><span class=
"special"><</span> <span class=
"identifier">F1
</span> <span class=
"special">></span><span class=
"special">,
</span> <span class=
"identifier">__function_type__
</span><span class=
"special"><</span> <span class=
"identifier">F2
</span> <span class=
"special">></span><span class=
"special">,
</span><span class=
"special">...
</span><span class=
"special">></span>
37 <span class=
"identifier">make_overloaded_function
</span><span class=
"special">(
</span><span class=
"identifier">F1
</span> f1
<span class=
"special">,
</span> <span class=
"identifier">F2
</span> f2
<span class=
"special">,
</span> <span class=
"special">...
</span><span class=
"special">)
</span><span class=
"special">;
</span></pre></div>
38 <div class=
"refsect1">
39 <a name=
"id821376"></a><h2>Description
</h2>
40 <p>This function template creates and returns an
<code class=
"computeroutput"><code class=
"computeroutput"><a class=
"link" href=
"overloaded_function.html" title=
"Class template overloaded_function">overloaded_function
</a></code></code> object that overloads all the specified functions
<code class=
"computeroutput">f1
</code>,
<code class=
"computeroutput">f2
</code>, etc.
</p>
41 <p>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
<code class=
"computeroutput"><code class=
"computeroutput"><a class=
"link" href=
"overloaded_function.html" title=
"Class template overloaded_function">overloaded_function
</a></code></code>. This is especially useful when the explicit type of the returned
<code class=
"computeroutput"><code class=
"computeroutput"><a class=
"link" href=
"overloaded_function.html" title=
"Class template overloaded_function">overloaded_function
</a></code></code> object does not need to be known (e.g., when used with Boost.Typeof's
<code class=
"computeroutput">BOOST_AUTO
</code>, C++
11 <code class=
"computeroutput">auto
</code>, or when the overloaded function object is handled using a function template parameter, see the
<a class=
"link" href=
"../boost_functional_overloadedfunction/tutorial.html" title=
"Tutorial"> Tutorial
</a> section).
</p>
42 <p>The maximum number of functions to overload is given by the
<code class=
"computeroutput"><code class=
"computeroutput"><a class=
"link" href=
"../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title=
"Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
</a></code></code> configuration macro.
</p>
43 <p><span class=
"bold"><strong>Note:
</strong></span> In this documentation,
<code class=
"computeroutput">__function_type__
</code> is a placeholder for a symbol that is specific to the implementation of this library.
</p>
44 <p><span class=
"bold"><strong>See:
</strong></span> <a class=
"link" href=
"../boost_functional_overloadedfunction/tutorial.html" title=
"Tutorial"> Tutorial
</a> section,
<code class=
"computeroutput"><code class=
"computeroutput"><a class=
"link" href=
"overloaded_function.html" title=
"Class template overloaded_function">overloaded_function
</a></code></code>,
<code class=
"computeroutput"><code class=
"computeroutput"><a class=
"link" href=
"../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX.html" title=
"Macro BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX">BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
</a></code></code>.
</p>
47 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
48 <td align=
"left"></td>
49 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2011,
2012 Lorenzo Caminiti
<p>
50 Distributed under the Boost Software License, Version
1.0 (see accompanying
51 file LICENSE_1_0.txt or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt" target=
"_top">http://www.boost.org/LICENSE_1_0.txt
</a>)
56 <div class=
"spirit-nav">
57 <a accesskey=
"p" href=
"overloaded_function.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../reference.html#header.boost.functional.overloaded_function_hpp"><img src=
"../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../index.html"><img src=
"../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"../BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>