1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com> 4 5 Distributed under the Boost Software License, Version 1.0. 6 (See accompanying file LICENSE_1_0.txt or copy at 7 http://www.boost.org/LICENSE_1_0.txt) 8 --> 9<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" 10 "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> 11<section id="function.history" last-revision="$Date$"> 12 <title>History & Compatibility Notes</title> 13 14<itemizedlist spacing="compact"> 15 16 <listitem><para><bold>Version 1.52.0</bold>: </para> 17 <itemizedlist spacing="compact"> 18 <listitem><para>Move constructors and move assignment 19 operators added (only for compilers with C++11 rvalue 20 references support). Original patch 21 contributed by Antony Polukhin.</para></listitem> 22 </itemizedlist> 23 </listitem> 24 25 <listitem><para><bold>Version 1.37.0</bold>: </para> 26 <itemizedlist spacing="compact"> 27 <listitem><para>Improved the performance of Boost.Function's 28 swap() operation for large function objects. Original patch 29 contributed by Niels Dekker.</para></listitem> 30 31 <listitem><para>Added a new header <boost/function/function_typeof.hpp> that provides support for using the Boost.Typeof library on Boost.Function objects.</para></listitem> 32 33 <listitem><para>Added a new header <boost/function/function_fwd.hpp> that provides support for using the Boost.Typeof library on Boost.Function objects.</para></listitem> 34 35 <listitem><para>The <methodname alt="boost::function::target">target</methodname>() 36 function now respects the cv-qualifiers of function objects 37 stored by reference 38 (using <classname>boost::reference_wrapper</classname>), such 39 that a reference to a <code>const</code> function object cannot 40 be accessed as a reference to a non-<code>const</code> function 41 object.</para></listitem> 42 </itemizedlist> 43 </listitem> 44 45 <listitem><para><bold>Version 1.36.0</bold>: </para> 46 <itemizedlist spacing="compact"> 47 <listitem><para>Boost.Function now implements allocator support 48 in the same way that is is provided in C++0x, based on C++ 49 committee 50 proposal <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2308.html">N2308</ulink>. This 51 change removes the <computeroutput>Allocator</computeroutput> 52 template parameter of <classname>boost::function</classname> in 53 favor of a constructor that takes an argument. While this is a 54 backward-incompatible change, it is likely to affect only a few 55 users. This change to Function was contributed by Emil 56 Dotchevski, which also authored the corresponding C++ committee 57 proposal.</para></listitem> 58 </itemizedlist> 59 </listitem> 60 61 <listitem><para><bold>Version 1.34.0</bold>: </para> 62 <itemizedlist spacing="compact"> 63 <listitem><para>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>bind(&X:foo, &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>swap()</code> may throw.</para></listitem> 64 </itemizedlist> 65 </listitem> 66 67 <listitem><para><bold>Version 1.30.0</bold>: </para> 68 <itemizedlist spacing="compact"> 69 <listitem><para>All features deprecated in version 1.29.0 have 70 been removed from Boost.Function.</para></listitem> 71 72 <listitem><para><code><classname>boost::function</classname></code> 73 and <code><classname>boost::functionN</classname></code> objects 74 can be assigned to 0 (semantically equivalent to calling 75 <code><methodname 76 alt="boost::function::clear">clear</methodname>()</code>) and 77 compared against 0 (semantically equivalent to calling 78 <code><methodname 79 alt="boost::function::empty">empty</methodname>()</code>).</para></listitem> 80 81 <listitem><para>The Boost.Function code is now generated 82 entirely by the <libraryname>Preprocessor</libraryname> library, 83 so it is now possible to generate 84 <code><classname>boost::function</classname></code> and 85 <code><classname>boost::functionN</classname></code> class 86 templates for any number of arguments.</para></listitem> 87 88 <listitem><para>The 89 <classname>boost::bad_function_call</classname> exception class 90 was introduced.</para></listitem> 91 </itemizedlist> 92 </listitem> 93 94 <listitem><para><bold>Version 1.29.0</bold>: 95 Boost.Function has been partially redesigned to minimize the 96 interface and make it cleaner. Several seldom- or never-used 97 features of the older Boost.Function have been deprecated and will 98 be removed in the near future. Here is a list of features that have 99 been deprecated, the likely impact of the deprecations, and how to 100 adjust your code: 101 102<itemizedlist spacing="compact"> 103 <listitem><para>The <computeroutput>boost::function</computeroutput> class template syntax has 104 changed. The old syntax, e.g., <computeroutput>boost::function<int, float, 105 double, std::string></computeroutput>, has been changed to a more natural 106 syntax <computeroutput>boost::function<int (float, double, 107 std::string)></computeroutput>, where all return and argument types are 108 encoded in a single function type parameter. Any other template 109 parameters (e.g., the <computeroutput>Allocator</computeroutput>) follow this single 110 parameter.</para> 111 112 <para> The resolution to this change depends on the 113 abilities of your compiler: if your compiler supports template 114 partial specialization and can parse function types (most do), modify 115 your code to use the newer 116 syntax (preferable) or directly use one of the 117 <computeroutput>functionN</computeroutput> classes whose syntax has not 118 changed. If your compiler does not support template partial 119 specialization or function types, you must take the latter option and 120 use the numbered Boost.Function classes. This option merely requires 121 changing types such as <computeroutput>boost::function<void, int, int></computeroutput> 122 to <computeroutput>boost::function2<void, int, int></computeroutput> (adding the number of 123 function arguments to the end of the class name).</para> 124 125 <para> Support for the old syntax with the 126 <computeroutput>boost::function</computeroutput> class template will persist for a short 127 while, but will eventually be removed so that we can provide better 128 error messages and link compatibility. </para></listitem> 129 130 <listitem><para>The invocation 131 policy template parameter (<computeroutput>Policy</computeroutput>) has been deprecated 132 and will be removed. There is no direct equivalent to this rarely 133 used feature.</para></listitem> 134 135 <listitem><para>The mixin template parameter 136 (<computeroutput>Mixin</computeroutput>) has been deprecated and will be removed. There 137 is not direct equivalent to this rarely used feature.</para></listitem> 138 139 <listitem><para>The 140 <computeroutput>set</computeroutput> methods have been deprecated and will be 141 removed. Use the assignment operator instead.</para></listitem> 142</itemizedlist> 143</para> 144</listitem> 145</itemizedlist> 146</section> 147