• 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>History &amp; Compatibility Notes</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="../function.html" title="Chapter 16. Boost.Function">
10<link rel="prev" href="../function.html" title="Chapter 16. Boost.Function">
11<link rel="next" href="tutorial.html" title="Tutorial">
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="../function.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.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="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="section">
27<div class="titlepage"><div><div><h2 class="title" style="clear: both">
28<a name="function.history"></a>History &amp; Compatibility Notes</h2></div></div></div>
29<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc; ">
30<li class="listitem">
31<p><span class="bold"><strong>Version 1.52.0</strong></span>: </p>
32<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: circle; "><li class="listitem"><p>Move constructors and move assignment
33      operators added (only for compilers with C++11 rvalue
34      references support). Original patch
35      contributed by Antony Polukhin.</p></li></ul></div>
36</li>
37<li class="listitem">
38<p><span class="bold"><strong>Version 1.37.0</strong></span>: </p>
39<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: circle; ">
40<li class="listitem"><p>Improved the performance of Boost.Function's
41      swap() operation for large function objects. Original patch
42      contributed by Niels Dekker.</p></li>
43<li class="listitem"><p>Added a new header &lt;boost/function/function_typeof.hpp&gt; that provides support for using the Boost.Typeof library on Boost.Function objects.</p></li>
44<li class="listitem"><p>Added a new header &lt;boost/function/function_fwd.hpp&gt; that provides support for using the Boost.Typeof library on Boost.Function objects.</p></li>
45<li class="listitem"><p>The <code class="computeroutput"><a class="link" href="../boost/function.html#id-1_3_17_6_2_1_4_29_1-bb">target</a></code>()
46      function now respects the cv-qualifiers of function objects
47      stored by reference
48      (using <code class="computeroutput">boost::reference_wrapper</code>), such
49      that a reference to a <code class="computeroutput">const</code> function object cannot
50      be accessed as a reference to a non-<code class="computeroutput">const</code> function
51      object.</p></li>
52</ul></div>
53</li>
54<li class="listitem">
55<p><span class="bold"><strong>Version 1.36.0</strong></span>: </p>
56<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: circle; "><li class="listitem"><p>Boost.Function now implements allocator support
57      in the same way that is is provided in C++0x, based on C++
58      committee
59      proposal <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2308.html" target="_top">N2308</a>. This
60      change removes the <code class="computeroutput">Allocator</code>
61      template parameter of <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> in
62      favor of a constructor that takes an argument. While this is a
63      backward-incompatible change, it is likely to affect only a few
64      users. This change to Function was contributed by Emil
65      Dotchevski, which also authored the corresponding C++ committee
66      proposal.</p></li></ul></div>
67</li>
68<li class="listitem">
69<p><span class="bold"><strong>Version 1.34.0</strong></span>: </p>
70<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: circle; "><li class="listitem"><p>Boost.Function now implements a small buffer optimization, which can drastically improve the performance when copying or construction Boost.Function objects storing small function objects. For instance, <code class="computeroutput">bind(&amp;X:foo, &amp;x, _1, _2)</code> requires no heap allocation when placed into a Boost.Function object. Note that some exception-safety guarantees have changed: assignment provides the basic exception guarantee and <code class="computeroutput">swap()</code> may throw.</p></li></ul></div>
71</li>
72<li class="listitem">
73<p><span class="bold"><strong>Version 1.30.0</strong></span>: </p>
74<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: circle; ">
75<li class="listitem"><p>All features deprecated in version 1.29.0 have
76      been removed from Boost.Function.</p></li>
77<li class="listitem"><p><code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code>
78      and <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::functionN</a></code> objects
79      can be assigned to 0 (semantically equivalent to calling
80      <code class="computeroutput"><a class="link" href="../boost/function.html#id-1_3_17_6_2_1_4_27_2-bb">clear</a>()</code>) and
81      compared against 0 (semantically equivalent to calling
82      <code class="computeroutput"><a class="link" href="../boost/function.html#id-1_3_17_6_2_1_4_28_1-bb">empty</a>()</code>).</p></li>
83<li class="listitem"><p>The Boost.Function code is now generated
84      entirely by the Preprocessor library,
85      so it is now possible to generate
86      <code class="computeroutput"><a class="link" href="../boost/function.html" title="Class template function">boost::function</a></code> and
87      <code class="computeroutput"><a class="link" href="../boost/functionN.html" title="Class template functionN">boost::functionN</a></code> class
88      templates for any number of arguments.</p></li>
89<li class="listitem"><p>The
90      <code class="computeroutput"><a class="link" href="../boost/bad_function_call.html" title="Class bad_function_call">boost::bad_function_call</a></code> exception class
91      was introduced.</p></li>
92</ul></div>
93</li>
94<li class="listitem">
95<p><span class="bold"><strong>Version 1.29.0</strong></span>:
96  Boost.Function has been partially redesigned to minimize the
97  interface and make it cleaner. Several seldom- or never-used
98  features of the older Boost.Function have been deprecated and will
99  be removed in the near future. Here is a list of features that have
100  been deprecated, the likely impact of the deprecations, and how to
101  adjust your code:
102
103</p>
104<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: circle; ">
105<li class="listitem">
106<p>The <code class="computeroutput">boost::function</code> class template syntax has
107  changed. The old syntax, e.g., <code class="computeroutput">boost::function&lt;int, float,
108  double, std::string&gt;</code>, has been changed to a more natural
109  syntax <code class="computeroutput">boost::function&lt;int (float, double,
110  std::string)&gt;</code>, where all return and argument types are
111  encoded in a single function type parameter. Any other template
112  parameters (e.g., the <code class="computeroutput">Allocator</code>) follow this single
113  parameter.</p>
114<p> The resolution to this change depends on the
115  abilities of your compiler: if your compiler supports template
116  partial specialization and can parse function types (most do), modify
117  your code to use the newer
118  syntax (preferable) or directly use one of the
119  <code class="computeroutput">functionN</code> classes whose syntax has not
120  changed. If your compiler does not support template partial
121  specialization or function types, you must take the latter option and
122  use the numbered Boost.Function classes. This option merely requires
123  changing types such as <code class="computeroutput">boost::function&lt;void, int, int&gt;</code>
124  to <code class="computeroutput">boost::function2&lt;void, int, int&gt;</code> (adding the number of
125  function arguments to the end of the class name).</p>
126<p> Support for the old syntax with the
127  <code class="computeroutput">boost::function</code> class template will persist for a short
128  while, but will eventually be removed so that we can provide better
129  error messages and link compatibility. </p>
130</li>
131<li class="listitem"><p>The invocation
132  policy template parameter (<code class="computeroutput">Policy</code>) has been deprecated
133  and will be removed. There is no direct equivalent to this rarely
134  used feature.</p></li>
135<li class="listitem"><p>The mixin template parameter
136  (<code class="computeroutput">Mixin</code>) has been deprecated and will be removed. There
137  is not direct equivalent to this rarely used feature.</p></li>
138<li class="listitem"><p>The
139  <code class="computeroutput">set</code> methods have been deprecated and will be
140  removed. Use the assignment operator instead.</p></li>
141</ul></div>
142<p>
143</p>
144</li>
145</ul></div>
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-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
150    Software License, Version 1.0. (See accompanying file
151    <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>
152</div></td>
153</tr></table>
154<hr>
155<div class="spirit-nav">
156<a accesskey="p" href="../function.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../function.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="tutorial.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
157</div>
158</body>
159</html>
160