CppCMS
|
This is Booster's implementation of std::tr1::function/booster::function. More...
#include <booster/booster/function.h>
Public Types | |
typedef Result | result_type |
Public Member Functions | |
function () | |
template<typename F > | |
function (F func) | |
function (function const &other) | |
template<typename F > | |
function const & | operator= (F func) |
function const & | operator= (function const &other) |
result_type | operator() (Params...params) const |
bool | empty () const |
operator bool () const | |
void | swap (function &other) |
This is Booster's implementation of std::tr1::function/booster::function.
This function is created from generic object that can be "called" i.e. a class with operator() or function pointer that has same signature as the function.
See: http://www.boost.org/doc/html/function.html
Notes:
typedef Result booster::function< Result(Params...)>::result_type |
Type of result, for use with boost::bind
booster::function< Result(Params...)>::function | ( | ) |
Default constructor, creates an empty functions
booster::function< Result(Params...)>::function | ( | F | func | ) |
Creates a function from a functional func of type F. func should be copyable. It is copied and stored inside function object.
booster::function< Result(Params...)>::function | ( | function< Result(Params...)> const & | other | ) |
Copy function, Copies underlying functional object.
bool booster::function< Result(Params...)>::empty | ( | ) | const |
Return true if the function is empty
booster::function< Result(Params...)>::operator bool | ( | ) | const |
Returns true if the function is not empty
result_type booster::function< Result(Params...)>::operator() | ( | Params... | params | ) | const |
Calls underling functional object. If the function is empty, throws bad_function_call.
function const& booster::function< Result(Params...)>::operator= | ( | F | func | ) |
Assign a functional func of type F. func should be copyable. It is copied and stored inside function object.
function const& booster::function< Result(Params...)>::operator= | ( | function< Result(Params...)> const & | other | ) |
Assignment operator. Copies underlying functional object.
void booster::function< Result(Params...)>::swap | ( | function< Result(Params...)> & | other | ) |
Swaps two functional object. Does not throw.