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