mirror of
https://github.com/boostorg/function.git
synced 2025-07-29 20:37:14 +02:00
Expand on the compatibility note
[SVN r14542]
This commit is contained in:
41
index.html
41
index.html
@ -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<int, float, double, std::string></code>, has been changed to a more natural syntax <code>boost::function<int (float, double, std::string)></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<int, float,
|
||||
double, std::string></code>, has been changed to a more natural
|
||||
syntax <code>boost::function<int (float, double,
|
||||
std::string)></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<void, int, int></code>
|
||||
to <code>boost::function2<void, int, int></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>
|
||||
|
Reference in New Issue
Block a user