1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Deferred Callable 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="reg_callable.html" title="Regular Callable Object"> 10<link rel="next" href="poly.html" title="Polymorphic Function Object"> 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="reg_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="poly.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.def_callable"></a><a class="link" href="def_callable.html" title="Deferred Callable Object">Deferred Callable 28 Object</a> 29</h4></div></div></div> 30<h6> 31<a name="fusion.functional.concepts.def_callable.h0"></a> 32 <span class="phrase"><a name="fusion.functional.concepts.def_callable.description"></a></span><a class="link" href="def_callable.html#fusion.functional.concepts.def_callable.description">Description</a> 33 </h6> 34<p> 35 <a class="link" href="callable.html" title="Callable Object">Callable Object</a> 36 types that work with <a href="http://www.boost.org/libs/utility/utility.htm#result_of" target="_top">ResultOf 37 utility</a> to determine the result of a call. 38 </p> 39<h6> 40<a name="fusion.functional.concepts.def_callable.h1"></a> 41 <span class="phrase"><a name="fusion.functional.concepts.def_callable.refinement_of"></a></span><a class="link" href="def_callable.html#fusion.functional.concepts.def_callable.refinement_of">Refinement 42 of</a> 43 </h6> 44<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> 45 <a class="link" href="callable.html" title="Callable Object">Callable Object</a> 46 </li></ul></div> 47<div class="blurb"> 48<div class="titlepage"><div><div><p class="title"><b></b></p></div></div></div> 49<p> 50 note Once C++ supports the <code class="literal">decltype</code> keyword, all models 51 of <a class="link" href="callable.html" title="Callable Object">Callable Object</a> 52 will also be models of <a class="link" href="def_callable.html" title="Deferred Callable Object">Deferred 53 Callable Object</a>, because function objects won't need client-side 54 support for <code class="computeroutput"><span class="identifier">result_of</span></code>. 55 </p> 56</div> 57<div class="variablelist"> 58<p class="title"><b>Notation</b></p> 59<dl class="variablelist"> 60<dt><span class="term"><code class="computeroutput"><span class="identifier">F</span></code></span></dt> 61<dd><p> 62 A possibly const qualified Deferred Callable Object type 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">&</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.def_callable.h2"></a> 83 <span class="phrase"><a name="fusion.functional.concepts.def_callable.expression_requirements"></a></span><a class="link" href="def_callable.html#fusion.functional.concepts.def_callable.expression_requirements">Expression 84 requirements</a> 85 </h6> 86<div class="informaltable"><table class="table"> 87<colgroup> 88<col> 89<col> 90</colgroup> 91<thead><tr> 92<th> 93 <p> 94 Expression 95 </p> 96 </th> 97<th> 98 <p> 99 Type 100 </p> 101 </th> 102</tr></thead> 103<tbody><tr> 104<td> 105 <p> 106 <a href="http://www.boost.org/libs/utility/utility.htm#result_of" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span></code></a><code class="computeroutput"><span class="special"><</span> <span class="identifier">F</span><span class="special">(</span><span class="identifier">T1</span> 107 <span class="special">...</span><span class="identifier">TN</span><span class="special">)</span> <span class="special">>::</span><span class="identifier">type</span></code> 108 </p> 109 </td> 110<td> 111 <p> 112 Result of a call with <code class="computeroutput"><span class="identifier">A1</span> 113 <span class="special">...</span><span class="identifier">AN</span></code>-typed 114 arguments 115 </p> 116 </td> 117</tr></tbody> 118</table></div> 119<h6> 120<a name="fusion.functional.concepts.def_callable.h3"></a> 121 <span class="phrase"><a name="fusion.functional.concepts.def_callable.models"></a></span><a class="link" href="def_callable.html#fusion.functional.concepts.def_callable.models">Models</a> 122 </h6> 123<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 124<li class="listitem"> 125 <a class="link" href="poly.html" title="Polymorphic Function Object">Polymorphic Function 126 Object</a> types 127 </li> 128<li class="listitem"> 129 member (function or data) pointer types 130 </li> 131</ul></div> 132<h6> 133<a name="fusion.functional.concepts.def_callable.h4"></a> 134 <span class="phrase"><a name="fusion.functional.concepts.def_callable.examples"></a></span><a class="link" href="def_callable.html#fusion.functional.concepts.def_callable.examples">Examples</a> 135 </h6> 136<pre class="programlisting"><span class="special">&</span> <span class="identifier">a_free_function</span> 137<span class="special">&</span> <span class="identifier">a_class</span><span class="special">::</span><span class="identifier">a_static_member_function</span> 138<span class="special">&</span> <span class="identifier">a_class</span><span class="special">::</span><span class="identifier">a_nonstatic_data_member</span> 139<span class="special">&</span> <span class="identifier">a_class</span><span class="special">::</span><span class="identifier">a_nonstatic_member_function</span> 140<span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special"><</span><span class="keyword">int</span><span class="special">>()</span> 141<span class="comment">// using namespace boost;</span> 142<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"><</span><span class="keyword">int</span><span class="special">>(),</span> <span class="identifier">_1</span><span class="special">,</span> <span class="number">5</span><span class="special">)</span> 143<span class="comment">// Note: Boost.Lambda expressions don't work with __boost_result_of__</span> 144<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"><</span><span class="keyword">int</span><span class="special">>())</span> 145</pre> 146</div> 147<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 148<td align="left"></td> 149<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 150 Dan Marsden, Tobias Schwinger<p> 151 Distributed under the Boost Software License, Version 1.0. (See accompanying 152 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>) 153 </p> 154</div></td> 155</tr></table> 156<hr> 157<div class="spirit-nav"> 158<a accesskey="p" href="reg_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="poly.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 159</div> 160</body> 161</html> 162