What is Boost::function ? I read the documentation but cann;t find any clear explanation. -- Linux
On Mon, Jul 13, 2009 at 11:06 AM, Wong Peter
What is Boost::function ?
I read the documentation but cann;t find any clear explanation.
It all seems very clear and obvious in the documentation. The introduction has an excellent and simple introduction. There are also documented motivations and examples in the tutorials. Please see: http://www.boost.org/doc/libs/1_39_0/doc/html/function.html
-- Linux
If you have any specific questions then please post with a little more information. I'm unable to guess what information you might need currently. Regards, Neil Groves
I try to read that and i guess it uses to store functor/function pointer for later callback. Am i correct ? Thanks.
Hi, Simply, boost::function unifies ptr to function, ptr to member function and function call operators into the same syntax. So, for example you can create an STL container and fill it with the variables above heterogenously and iterate over the container to call elements with the same syntax, i.e., (*iterator)(arguments); I recommend taking a look at boost::signal for a nice use case. Take care, emre On Tue, Jul 14, 2009 at 02:39:22PM +0800, Wong Peter wrote:
I try to read that and i guess it uses to store functor/function pointer for later callback.
Am i correct ?
Thanks.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Mon, Jul 13, 2009 at 11:06 AM, Wong Peter
What is Boost::function ?
I read the documentation but cann;t find any clear explanation.
Boost.Function is the generalisation of function pointers to function-like objects, ie., to callable objects. Specifically in callback situations, but also in general, this enables homogeneous treatment of callable objects. Function objects offer the benefit of internal state compared to simple functions. HTH - Rob.
On Mon, Jul 13, 2009 at 6:06 AM, Wong Peter
What is Boost::function ?
This is more to explain boost::bind(), but the 2 often go hand in hand. I've been saving this post for years as a cheat sheet for anyone who needs it. http://lists.boost.org/boost-users/2006/01/16310.php Thanks goes to delfin. Tony
participants (5)
-
Emre Turkay
-
Gottlob Frege
-
Neil Groves
-
Robert Jones
-
Wong Peter