mirror of
https://github.com/boostorg/function.git
synced 2025-07-14 05:06:34 +02:00
25 lines
232 B
C++
25 lines
232 B
C++
|
|
|
|
#include <boost/function.hpp>
|
|
#include <iostream>
|
|
#include <functional>
|
|
|
|
|
|
struct X {
|
|
int foo(int);
|
|
};
|
|
|
|
int X::foo(int x) { return -x; }
|
|
|
|
int main()
|
|
{
|
|
|
|
boost::function2<int, X*, int> f;
|
|
|
|
f = &X::foo;
|
|
|
|
X x;
|
|
f(&x, 5);
|
|
|
|
}
|