boost::bind



  • hi,

    was macht boost::bind...ist das quasi zum erstellen von funktoren? und was sind die vorteile gegenüber bind1st und bind2nd? wo ist da der unterschied zu boost::function?

    bye



  • hary schrieb:

    hi,
    was macht boost::bind...ist das quasi zum erstellen von funktoren? und was sind die vorteile gegenüber bind1st und bind2nd?

    boost.bind docu schrieb:

    boost::bind is a generalization of the standard functions std::bind1st and std::bind2nd. It supports arbitrary function objects, functions, function pointers, and member function pointers, and is able to bind any argument to a specific value or route input arguments into arbitrary positions. bind does not place any requirements on the function object; in particular, it does not need the result_type, first_argument_type and second_argument_type standard typedefs.

    wo ist da der unterschied zu boost::function?

    boost::bind nimmt eine "callable entity" sowie eine Menge von Argumenten, bindet die Argumente an vorhandene Parameter und liefert eine neue "callable entity".
    boost::function nimmt eine "callable entity" und erzeugt daraus eine "callable entity" mit einem wohlbekannten generischen Interface.



  • was ist ein callable entity?



  • Alles, was man in C++ mit der Syntax (asdf) (...) aufrufen kann (außer Konstruktoren), also Funktionen und Objekte einer Klasse mit einer Definition für operator().


Anmelden zum Antworten