How to pass function reference into arguments

Posted by Ockonal on Stack Overflow See other posts from Stack Overflow or by Ockonal
Published on 2010-06-01T16:42:34Z Indexed on 2010/06/01 16:43 UTC
Read the original article Hit count: 179

Filed under:
|
|
|
|

Hi, I'm using boost::function for making function-references:

typedef boost::function<void (SomeClass &handle)> Ref;
someFunc(Ref &pointer) {/*...*/}

void Foo(SomeClass &handle) {/*...*/}

What is the best way to pass Foo into the someFunc? I tried something like:

someFunc(Ref(Foo));

© Stack Overflow or respective owner

Related posts about c++

Related posts about function