Adapter to object instance
Hello, im looking through http://www.boost.org/libs/functional/index.html, there are ways to access a class method but i cant find a way to access a method of an object. How can i write an adapter for "instance.bar()" in this example: class foo { int _i; public: bar(); // manipulates _i } instance; Greetings, Yelve Yakut -- View this message in context: http://www.nabble.com/Adapter-to-object-instance-tf3632838.html#a10144039 Sent from the Boost - Users mailing list archive at Nabble.com.
MainBrain wrote:
Hello,
im looking through http://www.boost.org/libs/functional/index.html, there are ways to access a class method but i cant find a way to access a method of an object.
How can i write an adapter for "instance.bar()" in this example: class foo { int _i; public: bar(); // manipulates _i
did you mean: "void bar();"
} instance;
I'm not quite sure what you're after, but does this help?
...
boost::function
I'm not quite sure what you're after, but does this help?
...
boost::function
fnc = boost::bind( &foo::bar, boost::ref(instance) ); fnc(); // evaluate instance.bar()
Exactly what I was looking for. Thank you very much! Yelve -- View this message in context: http://www.nabble.com/Adapter-to-object-instance-tf3632838.html#a10178867 Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Jeff F
-
MainBrain