• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>Struct template callable</title>
6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9<link rel="up" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.callable_hpp" title="Header &lt;boost/type_erasure/callable.hpp&gt;">
10<link rel="prev" href="call.html" title="Function call">
11<link rel="next" href="check_match.html" title="Function check_match">
12</head>
13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14<table cellpadding="2" width="100%"><tr>
15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
16<td align="center"><a href="../../../../index.html">Home</a></td>
17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20<td align="center"><a href="../../../../more/index.htm">More</a></td>
21</tr></table>
22<hr>
23<div class="spirit-nav">
24<a accesskey="p" href="call.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.callable_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="check_match.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="boost.type_erasure.callable"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Struct template callable</span></h2>
30<p>boost::type_erasure::callable</p>
31</div>
32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
33<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.callable_hpp" title="Header &lt;boost/type_erasure/callable.hpp&gt;">boost/type_erasure/callable.hpp</a>&gt;
34
35</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Sig<span class="special">,</span> <span class="keyword">typename</span> F <span class="special">=</span> <a class="link" href="_self.html" title="Struct _self">_self</a><span class="special">&gt;</span>
36<span class="keyword">struct</span> <a class="link" href="callable.html" title="Struct template callable">callable</a> <span class="special">{</span>
37
38  <span class="comment">// <a class="link" href="callable.html#id-1_3_41_13_7_1_1_1_3-bb">public static functions</a></span>
39  <span class="keyword">static</span> <span class="identifier">R</span> <a class="link" href="callable.html#id-1_3_41_13_7_1_1_1_3_1-bb"><span class="identifier">apply</span></a><span class="special">(</span><span class="identifier">F</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...</span><span class="special">)</span><span class="special">;</span>
40<span class="special">}</span><span class="special">;</span></pre></div>
41<div class="refsect1">
42<a name="id-1.3.41.13.8.3.4"></a><h2>Description</h2>
43<p>The <a class="link" href="callable.html" title="Struct template callable">callable</a> concept allows an <a class="link" href="any.html" title="Class template any">any</a> to hold function objects. <code class="computeroutput">Sig</code> is interpreted in the same way as for Boost.Function, except that the arguments and return type are allowed to be placeholders. <code class="computeroutput">F</code> must be a <a class="link" href="placeholder.html" title="Struct placeholder">placeholder</a>.</p>
44<p>Multiple instances of <a class="link" href="callable.html" title="Struct template callable">callable</a> can be used simultaneously. Overload resolution works normally. Note that unlike Boost.Function, <a class="link" href="callable.html" title="Struct template callable">callable</a> does not provide result_type. It does, however, support <code class="computeroutput">boost::result_of</code>. </p>
45<div class="refsect2">
46<a name="id-1.3.41.13.8.3.4.4"></a><h3>
47<a name="id-1_3_41_13_7_1_1_1_3-bb"></a><code class="computeroutput">callable</code> public static functions</h3>
48<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
49<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">R</span> <a name="id-1_3_41_13_7_1_1_1_3_1-bb"></a><span class="identifier">apply</span><span class="special">(</span><span class="identifier">F</span> <span class="special">&amp;</span> f<span class="special">,</span> <span class="identifier">T</span><span class="special">...</span> arg<span class="special">)</span><span class="special">;</span></pre>
50<p><code class="computeroutput">R</code> is the result type of <code class="computeroutput">Sig</code> and <code class="computeroutput">T</code> is the argument types of <code class="computeroutput">Sig</code>. </p>
51</li></ol></div>
52</div>
53</div>
54</div>
55<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
56<td align="left"></td>
57<td align="right"><div class="copyright-footer">Copyright © 2011-2013 Steven Watanabe<p>
58        Distributed under the Boost Software License, Version 1.0. (See accompanying
59        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>)
60      </p>
61</div></td>
62</tr></table>
63<hr>
64<div class="spirit-nav">
65<a accesskey="p" href="call.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.callable_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="check_match.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
66</div>
67</body>
68</html>
69