mirror of
https://github.com/boostorg/function.git
synced 2025-07-18 15:12:09 +02:00
Updated docs to reflect changes in code:
- assignments/constructors that took const F& now take F - no need to use &free_function for assignment from free functions, unless using MSVC6.5 [SVN r11946]
This commit is contained in:
@ -60,9 +60,11 @@ else
|
||||
<p> Free function pointers can be considered singleton function objects with const function call operators, and can therefore be directly used with the function object wrappers:
|
||||
<pre>
|
||||
float mul_ints(int x, int y) { return ((float)x) * y; }
|
||||
f = &mul_ints;
|
||||
f = &mul_ints;
|
||||
</pre>
|
||||
|
||||
<p> Note that the <code>&</code> isn't really necessary unless you happen to be using Microsoft Visual C++ version 6.
|
||||
|
||||
<h3>Member functions</h3>
|
||||
<a name="member_func">
|
||||
<p> In many systems, callbacks often call to member functions of a particular
|
||||
@ -73,10 +75,10 @@ object. This is often referred to as "argument binding", and is beyond the scope
|
||||
};
|
||||
|
||||
boost::function<int, X*, int> f;
|
||||
f = &X::foo;
|
||||
f = &X::foo;
|
||||
|
||||
X x;
|
||||
f(&x, 5);
|
||||
f(&x, 5);
|
||||
</pre>
|
||||
<p> Several libraries exist that support argument binding. Three such libraries are summarized below:
|
||||
<ul>
|
||||
@ -196,7 +198,7 @@ boost::function2<float, int, int, SynchronizedPolicy, SynchronizedMixin> f
|
||||
<address><a href="mailto:gregod@cs.rpi.edu">Douglas Gregor</a></address>
|
||||
<!-- Created: Fri Jul 13 12:47:11 EDT 2001 -->
|
||||
<!-- hhmts start -->
|
||||
Last modified: Sun Oct 28 00:49:02 EDT 2001
|
||||
Last modified: Wed Dec 5 17:48:40 EST 2001
|
||||
<!-- hhmts end -->
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user