<?xml version="1.0" encoding="utf-8"?>
<!--
   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
  
   Distributed under the Boost Software License, Version 1.0.
   (See accompanying file LICENSE_1_0.txt or copy at
   http://www.boost.org/LICENSE_1_0.txt)
  -->
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<section id="function.history" last-revision="$Date: 2006/11/03 19:41:09 $">
  <title>History &amp; Compatibility Notes</title>

<itemizedlist spacing="compact">

  <listitem><para><bold>Version 1.34.0</bold>: </para> 
    <itemizedlist spacing="compact">
      <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(&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>swap()</code> may throw.</para></listitem>
    </itemizedlist>
  </listitem>

  <listitem><para><bold>Version 1.30.0</bold>: </para> 
    <itemizedlist spacing="compact">
      <listitem><para>All features deprecated in version 1.29.0 have
      been removed from Boost.Function.</para></listitem>
 
      <listitem><para><code><classname>boost::function</classname></code>
      and <code><classname>boost::functionN</classname></code> objects
      can be assigned to 0 (semantically equivalent to calling
      <code><methodname
      alt="boost::function::clear">clear</methodname>()</code>) and
      compared against 0 (semantically equivalent to calling
      <code><methodname
      alt="boost::function::empty">empty</methodname>()</code>).</para></listitem>

      <listitem><para>The Boost.Function code is now generated
      entirely by the <libraryname>Preprocessor</libraryname> library,
      so it is now possible to generate
      <code><classname>boost::function</classname></code> and
      <code><classname>boost::functionN</classname></code> class
      templates for any number of arguments.</para></listitem>

      <listitem><para>The
      <classname>boost::bad_function_call</classname> exception class
      was introduced.</para></listitem>
      </itemizedlist>
  </listitem>

  <listitem><para><bold>Version 1.29.0</bold>:
  Boost.Function has been partially redesigned to minimize the
  interface and make it cleaner. Several seldom- or never-used
  features of the older Boost.Function have been deprecated and will
  be removed in the near future. Here is a list of features that have
  been deprecated, the likely impact of the deprecations, and how to
  adjust your code:

<itemizedlist spacing="compact">
  <listitem><para>The <computeroutput>boost::function</computeroutput> class template syntax has
  changed. The old syntax, e.g., <computeroutput>boost::function&lt;int, float,
  double, std::string&gt;</computeroutput>, has been changed to a more natural
  syntax <computeroutput>boost::function&lt;int (float, double,
  std::string)&gt;</computeroutput>, where all return and argument types are
  encoded in a single function type parameter. Any other template
  parameters (e.g., the <computeroutput>Allocator</computeroutput>) follow this single
  parameter.</para>

  <para> The resolution to this change depends on the
  abilities of your compiler: if your compiler supports template
  partial specialization and can parse function types (most do), modify 
  your code to use the newer
  syntax (preferable) or directly use one of the
  <computeroutput>functionN</computeroutput> classes whose syntax has not
  changed. If your compiler does not support template partial
  specialization or function types, you must take the latter option and 
  use the numbered Boost.Function classes. This option merely requires 
  changing types such as <computeroutput>boost::function&lt;void, int, int&gt;</computeroutput>
  to <computeroutput>boost::function2&lt;void, int, int&gt;</computeroutput> (adding the number of
  function arguments to the end of the class name).</para>

  <para> Support for the old syntax with the
  <computeroutput>boost::function</computeroutput> class template will persist for a short
  while, but will eventually be removed so that we can provide better
  error messages and link compatibility. </para></listitem> 

  <listitem><para>The invocation
  policy template parameter (<computeroutput>Policy</computeroutput>) has been deprecated
  and will be removed. There is no direct equivalent to this rarely
  used feature.</para></listitem> 

  <listitem><para>The mixin template parameter
  (<computeroutput>Mixin</computeroutput>) has been deprecated and will be removed. There
  is not direct equivalent to this rarely used feature.</para></listitem> 

  <listitem><para>The
  <computeroutput>set</computeroutput> methods have been deprecated and will be
  removed. Use the assignment operator instead.</para></listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</section>
