mirror of
https://github.com/boostorg/function.git
synced 2025-07-03 15:56:31 +02:00
23 lines
202 B
C++
23 lines
202 B
C++
![]() |
|
||
|
|
||
|
#include <boost/function.hpp>
|
||
|
#include <iostream>
|
||
|
#include <functional>
|
||
|
|
||
|
|
||
|
struct X {
|
||
|
int foo(int);
|
||
|
};
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
|
||
|
boost::function<int (X*, int)> f;
|
||
|
|
||
|
f = &X::foo;
|
||
|
|
||
|
X x;
|
||
|
f(&x, 5);
|
||
|
|
||
|
}
|
||
|
|