Expand on the compatibility note

[SVN r14542]
This commit is contained in:
Douglas Gregor
2002-07-19 21:21:56 +00:00
parent 7ad9e2afee
commit 461e51a592

View File

@ -27,12 +27,41 @@
<a name="compatibility"><h2>Compatibility Note</h2></a>
<p> 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:
<ul>
<li>The <code>boost::function</code> class template syntax has changed. The old syntax, e.g., <code>boost::function&lt;int, float, double, std::string&gt;</code>, has been changed to a more natural syntax <code>boost::function&lt;int (float, double, std::string)&gt;</code>, where all return and argument types are encoded in a single function type parameter. Any other template parameters (e.g., the <code>Allocator</code>) follow this single parameter.
<p> The resolution to this change depends on the abilities of your compiler: if your compiler supports template partial specialization (most do), modify your code to use the newer syntax (preferable) or directly use one of the <code>function<em>N</em></code> classes whose syntax has not changed. If your compiler does not support template partial specialization, you must take the latter option and use the numbered Boost.Function classes.
<p> Support for the old syntax with the <code>boost::function</code> class template will persist for a short while, but will eventually be removed so that we can provide better error messages and link compatibility. </li>
<li>The invocation policy template parameter (<code>Policy</code>) has been deprecated and will be removed. There is no direct equivalent to this rarely used feature.</li>
<li>The mixin template parameter (<code>Mixin</code>) has been deprecated and will be removed. There is not direct equivalent to this rarely used feature.</li>
<li>The <code>set</code> methods have been deprecated and will be removed. Use the assignment operator instead.</li>
<li>The <code>boost::function</code> class template syntax has
changed. The old syntax, e.g., <code>boost::function&lt;int, float,
double, std::string&gt;</code>, has been changed to a more natural
syntax <code>boost::function&lt;int (float, double,
std::string)&gt;</code>, where all return and argument types are
encoded in a single function type parameter. Any other template
parameters (e.g., the <code>Allocator</code>) follow this single
parameter.
<p> 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
<code>function<em>N</em></code> 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 <code>boost::function&lt;void, int, int&gt;</code>
to <code>boost::function2&lt;void, int, int&gt;</code> (adding the number of
function arguments to the end of the class name).
<p> Support for the old syntax with the
<code>boost::function</code> class template will persist for a short
while, but will eventually be removed so that we can provide better
error messages and link compatibility. </li>
<li>The invocation
policy template parameter (<code>Policy</code>) has been deprecated
and will be removed. There is no direct equivalent to this rarely
used feature.</li> <li>The mixin template parameter
(<code>Mixin</code>) has been deprecated and will be removed. There
is not direct equivalent to this rarely used feature.</li> <li>The
<code>set</code> methods have been deprecated and will be
removed. Use the assignment operator instead.</li>
</ul>
<h2><a name="vspointers">Boost.Function vs. Function Pointers</a></h2>