• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Polymorphic Function Object</title>
5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../../index.html" title="Chapter 1. Fusion 2.2">
8<link rel="up" href="../concepts.html" title="Concepts">
9<link rel="prev" href="def_callable.html" title="Deferred Callable Object">
10<link rel="next" href="../invocation.html" title="Invocation">
11</head>
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>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="def_callable.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><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="../invocation.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h4 class="title">
27<a name="fusion.functional.concepts.poly"></a><a class="link" href="poly.html" title="Polymorphic Function Object">Polymorphic Function
28        Object</a>
29</h4></div></div></div>
30<h6>
31<a name="fusion.functional.concepts.poly.h0"></a>
32          <span class="phrase"><a name="fusion.functional.concepts.poly.description"></a></span><a class="link" href="poly.html#fusion.functional.concepts.poly.description">Description</a>
33        </h6>
34<p>
35          A non-member-pointer <a class="link" href="def_callable.html" title="Deferred Callable Object">Deferred
36          Callable Object</a> type.
37        </p>
38<h6>
39<a name="fusion.functional.concepts.poly.h1"></a>
40          <span class="phrase"><a name="fusion.functional.concepts.poly.refinement_of"></a></span><a class="link" href="poly.html#fusion.functional.concepts.poly.refinement_of">Refinement
41          of</a>
42        </h6>
43<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
44<li class="listitem">
45              <a class="link" href="reg_callable.html" title="Regular Callable Object">Regular Callable
46              Object</a>
47            </li>
48<li class="listitem">
49              <a class="link" href="def_callable.html" title="Deferred Callable Object">Deferred Callable
50              Object</a>
51            </li>
52</ul></div>
53<div class="variablelist">
54<p class="title"><b>Notation</b></p>
55<dl class="variablelist">
56<dt><span class="term"><code class="computeroutput"><span class="identifier">F</span></code></span></dt>
57<dd><p>
58                A possibly const-qualified Polymorphic Function Object type
59              </p></dd>
60<dt><span class="term"><code class="computeroutput"><span class="identifier">f</span></code></span></dt>
61<dd><p>
62                An object or reference to an object of type F
63              </p></dd>
64<dt><span class="term"><code class="computeroutput"><span class="identifier">A1</span> <span class="special">...</span><span class="identifier">AN</span></code></span></dt>
65<dd><p>
66                Argument types
67              </p></dd>
68<dt><span class="term"><code class="computeroutput"><span class="identifier">a1</span> <span class="special">...</span><span class="identifier">aN</span></code></span></dt>
69<dd><p>
70                Objects or references to objects with types <code class="computeroutput"><span class="identifier">A1</span>
71                <span class="special">...</span><span class="identifier">AN</span></code>
72              </p></dd>
73<dt><span class="term"><code class="computeroutput"><span class="identifier">T1</span> <span class="special">...</span><span class="identifier">TN</span></code></span></dt>
74<dd><p>
75                <code class="computeroutput"><span class="identifier">T</span></code>i is <code class="computeroutput"><span class="identifier">A</span></code>i <code class="computeroutput"><span class="special">&amp;</span></code>
76                if <code class="computeroutput"><span class="identifier">a</span></code>i is an LValue,
77                same as <code class="computeroutput"><span class="identifier">A</span></code>i, otherwise
78              </p></dd>
79</dl>
80</div>
81<h6>
82<a name="fusion.functional.concepts.poly.h2"></a>
83          <span class="phrase"><a name="fusion.functional.concepts.poly.expression_requirements"></a></span><a class="link" href="poly.html#fusion.functional.concepts.poly.expression_requirements">Expression
84          requirements</a>
85        </h6>
86<div class="informaltable"><table class="table">
87<colgroup>
88<col>
89<col>
90<col>
91</colgroup>
92<thead><tr>
93<th>
94                  <p>
95                    Expression
96                  </p>
97                </th>
98<th>
99                  <p>
100                    Return Type
101                  </p>
102                </th>
103<th>
104                  <p>
105                    Runtime Complexity
106                  </p>
107                </th>
108</tr></thead>
109<tbody><tr>
110<td>
111                  <p>
112                    <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">a1</span><span class="special">,</span>
113                    <span class="special">...</span><span class="identifier">aN</span><span class="special">)</span></code>
114                  </p>
115                </td>
116<td>
117                  <p>
118                    <code class="computeroutput"><span class="identifier">result_of</span><span class="special">&lt;</span>
119                    <span class="identifier">F</span><span class="special">(</span><span class="identifier">T1</span><span class="special">,</span>
120                    <span class="special">...</span><span class="identifier">TN</span><span class="special">)</span> <span class="special">&gt;::</span><span class="identifier">type</span></code>
121                  </p>
122                </td>
123<td>
124                  <p>
125                    Unspecified
126                  </p>
127                </td>
128</tr></tbody>
129</table></div>
130<h6>
131<a name="fusion.functional.concepts.poly.h3"></a>
132          <span class="phrase"><a name="fusion.functional.concepts.poly.models"></a></span><a class="link" href="poly.html#fusion.functional.concepts.poly.models">Models</a>
133        </h6>
134<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
135<li class="listitem">
136              function pointers
137            </li>
138<li class="listitem">
139              function objects of the Standard Library
140            </li>
141<li class="listitem">
142              all Fusion <a class="link" href="../adapters.html" title="Adapters">functional adapters</a>
143            </li>
144</ul></div>
145<h6>
146<a name="fusion.functional.concepts.poly.h4"></a>
147          <span class="phrase"><a name="fusion.functional.concepts.poly.examples"></a></span><a class="link" href="poly.html#fusion.functional.concepts.poly.examples">Examples</a>
148        </h6>
149<pre class="programlisting"><span class="special">&amp;</span> <span class="identifier">a_free_function</span>
150<span class="special">&amp;</span> <span class="identifier">a_class</span><span class="special">::</span><span class="identifier">a_static_member_function</span>
151<span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;()</span>
152<span class="comment">// using namespace boost;</span>
153<span class="identifier">bind</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(),</span> <span class="identifier">_1</span><span class="special">,</span> <span class="number">5</span><span class="special">)</span>
154<span class="comment">// Note: Boost.Lambda expressions don't work with __boost_result_of__</span>
155<span class="identifier">fusion</span><span class="special">::</span><a class="link" href="../generation/functions/mk_fused_fobj.html" title="make_fused_function_object"><code class="computeroutput"><span class="identifier">make_fused_function_object</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;())</span>
156</pre>
157</div>
158<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
159<td align="left"></td>
160<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman,
161      Dan Marsden, Tobias Schwinger<p>
162        Distributed under the Boost Software License, Version 1.0. (See accompanying
163        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>)
164      </p>
165</div></td>
166</tr></table>
167<hr>
168<div class="spirit-nav">
169<a accesskey="p" href="def_callable.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><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="../invocation.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
170</div>
171</body>
172</html>
173