| 1 | <?xml version="1.0" encoding="utf-8"?> |
|---|
| 2 | <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" |
|---|
| 3 | "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> |
|---|
| 4 | <section id="function.history" last-revision="$Date: 2005/01/23 16:23:09 $"> |
|---|
| 5 | <title>History & Compatibility Notes</title> |
|---|
| 6 | |
|---|
| 7 | <itemizedlist spacing="compact"> |
|---|
| 8 | <listitem><para><bold>Version 1.30.0</bold>: </para> |
|---|
| 9 | <itemizedlist spacing="compact"> |
|---|
| 10 | <listitem><para>All features deprecated in version 1.29.0 have |
|---|
| 11 | been removed from Boost.Function.</para></listitem> |
|---|
| 12 | |
|---|
| 13 | <listitem><para><code><classname>boost::function</classname></code> |
|---|
| 14 | and <code><classname>boost::functionN</classname></code> objects |
|---|
| 15 | can be assigned to 0 (semantically equivalent to calling |
|---|
| 16 | <code><methodname |
|---|
| 17 | alt="boost::function::clear">clear</methodname>()</code>) and |
|---|
| 18 | compared against 0 (semantically equivalent to calling |
|---|
| 19 | <code><methodname |
|---|
| 20 | alt="boost::function::empty">empty</methodname>()</code>).</para></listitem> |
|---|
| 21 | |
|---|
| 22 | <listitem><para>The Boost.Function code is now generated |
|---|
| 23 | entirely by the <libraryname>Preprocessor</libraryname> library, |
|---|
| 24 | so it is now possible to generate |
|---|
| 25 | <code><classname>boost::function</classname></code> and |
|---|
| 26 | <code><classname>boost::functionN</classname></code> class |
|---|
| 27 | templates for any number of arguments.</para></listitem> |
|---|
| 28 | |
|---|
| 29 | <listitem><para>The |
|---|
| 30 | <classname>boost::bad_function_call</classname> exception class |
|---|
| 31 | was introduced.</para></listitem> |
|---|
| 32 | </itemizedlist> |
|---|
| 33 | </listitem> |
|---|
| 34 | |
|---|
| 35 | <listitem><para><bold>Version 1.29.0</bold>: |
|---|
| 36 | Boost.Function has been partially redesigned to minimize the |
|---|
| 37 | interface and make it cleaner. Several seldom- or never-used |
|---|
| 38 | features of the older Boost.Function have been deprecated and will |
|---|
| 39 | be removed in the near future. Here is a list of features that have |
|---|
| 40 | been deprecated, the likely impact of the deprecations, and how to |
|---|
| 41 | adjust your code: |
|---|
| 42 | |
|---|
| 43 | <itemizedlist spacing="compact"> |
|---|
| 44 | <listitem><para>The <computeroutput>boost::function</computeroutput> class template syntax has |
|---|
| 45 | changed. The old syntax, e.g., <computeroutput>boost::function<int, float, |
|---|
| 46 | double, std::string></computeroutput>, has been changed to a more natural |
|---|
| 47 | syntax <computeroutput>boost::function<int (float, double, |
|---|
| 48 | std::string)></computeroutput>, where all return and argument types are |
|---|
| 49 | encoded in a single function type parameter. Any other template |
|---|
| 50 | parameters (e.g., the <computeroutput>Allocator</computeroutput>) follow this single |
|---|
| 51 | parameter.</para> |
|---|
| 52 | |
|---|
| 53 | <para> The resolution to this change depends on the |
|---|
| 54 | abilities of your compiler: if your compiler supports template |
|---|
| 55 | partial specialization and can parse function types (most do), modify |
|---|
| 56 | your code to use the newer |
|---|
| 57 | syntax (preferable) or directly use one of the |
|---|
| 58 | <computeroutput>functionN</computeroutput> classes whose syntax has not |
|---|
| 59 | changed. If your compiler does not support template partial |
|---|
| 60 | specialization or function types, you must take the latter option and |
|---|
| 61 | use the numbered Boost.Function classes. This option merely requires |
|---|
| 62 | changing types such as <computeroutput>boost::function<void, int, int></computeroutput> |
|---|
| 63 | to <computeroutput>boost::function2<void, int, int></computeroutput> (adding the number of |
|---|
| 64 | function arguments to the end of the class name).</para> |
|---|
| 65 | |
|---|
| 66 | <para> Support for the old syntax with the |
|---|
| 67 | <computeroutput>boost::function</computeroutput> class template will persist for a short |
|---|
| 68 | while, but will eventually be removed so that we can provide better |
|---|
| 69 | error messages and link compatibility. </para></listitem> |
|---|
| 70 | |
|---|
| 71 | <listitem><para>The invocation |
|---|
| 72 | policy template parameter (<computeroutput>Policy</computeroutput>) has been deprecated |
|---|
| 73 | and will be removed. There is no direct equivalent to this rarely |
|---|
| 74 | used feature.</para></listitem> |
|---|
| 75 | |
|---|
| 76 | <listitem><para>The mixin template parameter |
|---|
| 77 | (<computeroutput>Mixin</computeroutput>) has been deprecated and will be removed. There |
|---|
| 78 | is not direct equivalent to this rarely used feature.</para></listitem> |
|---|
| 79 | |
|---|
| 80 | <listitem><para>The |
|---|
| 81 | <computeroutput>set</computeroutput> methods have been deprecated and will be |
|---|
| 82 | removed. Use the assignment operator instead.</para></listitem> |
|---|
| 83 | </itemizedlist> |
|---|
| 84 | </para> |
|---|
| 85 | </listitem> |
|---|
| 86 | </itemizedlist> |
|---|
| 87 | </section> |
|---|