libsigc++: ptr_fun()
ptr_fun() is used to convert a pointer to a function to a functor. More...
Functions | |
| template<class T_return > | |
| pointer_functor0< T_return > | sigc::ptr_fun0 (T_return(* _A_func)()) |
| Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_return > | |
| pointer_functor1< T_arg1, T_return > | sigc::ptr_fun1 (T_return(* _A_func)(T_arg1)) |
| Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_return > | |
| pointer_functor2< T_arg1, T_arg2, T_return > | sigc::ptr_fun2 (T_return(* _A_func)(T_arg1, T_arg2)) |
| Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_return > | |
| pointer_functor3< T_arg1, T_arg2, T_arg3, T_return > | sigc::ptr_fun3 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3)) |
| Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_return > | |
| pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_return > | sigc::ptr_fun4 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4)) |
| Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_return > | |
| pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_return > | sigc::ptr_fun5 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)) |
| Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_return > | |
| pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_return > | sigc::ptr_fun6 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)) |
| Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 , class T_return > | |
| pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_return > | sigc::ptr_fun7 (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)) |
| Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function. | |
| template<class T_return > | |
| pointer_functor0< T_return > | sigc::ptr_fun (T_return(* _A_func)()) |
| Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_return > | |
| pointer_functor1< T_arg1, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1)) |
| Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_return > | |
| pointer_functor2< T_arg1, T_arg2, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2)) |
| Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_return > | |
| pointer_functor3< T_arg1, T_arg2, T_arg3, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3)) |
| Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_return > | |
| pointer_functor4< T_arg1, T_arg2, T_arg3, T_arg4, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4)) |
| Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_return > | |
| pointer_functor5< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5)) |
| Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_return > | |
| pointer_functor6< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6)) |
| Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function. | |
| template<class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 , class T_return > | |
| pointer_functor7< T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_return > | sigc::ptr_fun (T_return(* _A_func)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)) |
| Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function. | |
Detailed Description
ptr_fun() is used to convert a pointer to a function to a functor.
If the function pointer is to an overloaded type, you must specify the types using template arguments starting with the first argument. It is not necessary to supply the return type.
- Example:
- void foo(int) {}sigc::slot<void, int> sl = sigc::ptr_fun(&foo);
Use ptr_fun#() if there is an ambiguity as to the number of arguments.
- Example:
- void foo(int) {} // choose this onevoid foo(float) {}void foo(int, int) {}sigc::slot<void, long> sl = sigc::ptr_fun1<int>(&foo);
ptr_fun() can also be used to convert a pointer to a static member function to a functor, like so:
- Example:
Function Documentation
|
inline |
Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor0 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor1 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor2 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor3 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor4 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor5 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor6 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
|
inline |
Creates a functor of type sigc::pointer_functor7 which wraps an existing non-member function.
- Parameters:
-
_A_func Pointer to function that should be wrapped.
- Returns:
- Functor that executes _A_func on invokation.
