blob: c325c8a3d8cbdc3c4c95fdfd58459160dd30e988 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter 16. Boost.Function</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
<link rel="prev" href="foreach/history_and_acknowledgements.html" title="History and Acknowledgements">
<link rel="next" href="function/history.html" title="History & Compatibility Notes">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.html">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="foreach/history_and_acknowledgements.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.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="function/history.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="function"></a>Chapter 16. Boost.Function</h2></div>
<div><div class="author">
<h3 class="author">
<span class="firstname">Douglas</span> <span class="surname">Gregor</span>
</h3>
<code class="email"><<a class="email" href="mailto:dgregor%20-at-%20cs.indiana.edu">dgregor -at- cs.indiana.edu</a>></code>
</div></div>
<div><p class="copyright">Copyright © 2001-2004 Douglas Gregor</p></div>
<div><div class="legalnotice">
<a name="id-1.3.17.1.3"></a><p>Use, modification and distribution is subject to the Boost
Software License, Version 1.0. (See accompanying file
<code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="function.html#function.intro">Introduction</a></span></dt>
<dt><span class="section"><a href="function/history.html">History & Compatibility Notes</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html">Tutorial</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.17.5.4">Basic Usage</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.17.5.5">Free functions</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.17.5.6">Member functions</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.17.5.7">References to Function Objects</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.17.5.8">Comparing Boost.Function function objects</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="function/reference.html">Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/reference.html#function.definitions">Definitions</a></span></dt>
<dt><span class="section"><a href="function/reference.html#header.boost.function_hpp">Header <boost/function.hpp></a></span></dt>
<dt><span class="section"><a href="function/reference.html#header.boost.function_equal_hpp">Header <boost/function_equal.hpp></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="function/faq.html">Frequently Asked Questions</a></span></dt>
<dt><span class="section"><a href="function/misc.html">Miscellaneous Notes</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/misc.html#id-1.3.17.8.2">Boost.Function vs. Function Pointers</a></span></dt>
<dt><span class="section"><a href="function/misc.html#id-1.3.17.8.3">Performance</a></span></dt>
<dt><span class="section"><a href="function/misc.html#id-1.3.17.8.4">Combatting virtual function "bloat"</a></span></dt>
<dt><span class="section"><a href="function/misc.html#id-1.3.17.8.5">Acknowledgements</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="function/testsuite.html">Testsuite</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/testsuite.html#function.testsuite.acceptance">Acceptance tests</a></span></dt>
<dt><span class="section"><a href="function/testsuite.html#function.testsuite.negative">Negative tests</a></span></dt>
</dl></dd>
</dl>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="function.intro"></a>Introduction</h2></div></div></div>
<p>The Boost.Function library contains a family of class templates
that are function object wrappers. The notion is similar to a
generalized callback. It shares features with function pointers in
that both define a call interface (e.g., a function taking two integer
arguments and returning a floating-point value) through which some
implementation can be called, and the implementation that is invoked
may change throughout the course of the program.</p>
<p> Generally, any place in which a function pointer would be used
to defer a call or make a callback, Boost.Function can be used instead
to allow the user greater flexibility in the implementation of the
target. Targets can be any 'compatible' function object (or function
pointer), meaning that the arguments to the interface designated by
Boost.Function can be converted to the arguments of the target
function object.</p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="foreach/history_and_acknowledgements.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.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="function/history.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|