c++-gtk-utils

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Classes | Typedefs | Functions
Cgu::Callback Namespace Reference

This namespace provides classes for type erasure. More...

## Classes
class | Callback_fun_tuple
class | Callback_lambda
class | Callback_memfun
class | Callback_memfun_tuple
class | CallbackArg
| The callback interface class. More...
class | FunctorArg
| Functor class holding a Callback::CallbackArg object. More...
class | SafeFunctorArg
| Functor class holding a Callback::CallbackArg object, with thread-safe reference count. More...

## Typedefs
typedef CallbackArg | Callback
typedef FunctorArg | Functor
typedef SafeFunctorArg | SafeFunctor

## Functions
template<class... T>
std::unique_ptr< const CallbackArg< T... > > | to_unique (const CallbackArg< T... > *cb) noexcept
template<class... T>
bool | operator== (const FunctorArg< T... > &f1, const FunctorArg< T... > &f2) noexcept
template<class... T>
bool | operator!= (const FunctorArg< T... > &f1, const FunctorArg< T... > &f2) noexcept
template<class... T>
bool | operator< (const FunctorArg< T... > &f1, const FunctorArg< T... > &f2)
template<class... T>
bool | operator== (const SafeFunctorArg< T... > &f1, const SafeFunctorArg< T... > &f2) noexcept
template<class... T>
bool | operator!= (const SafeFunctorArg< T... > &f1, const SafeFunctorArg< T... > &f2) noexcept
template<class... T>
bool | operator< (const SafeFunctorArg< T... > &f1, const SafeFunctorArg< T... > &f2)
template<class... T>
FunctorArg< T... > | to_functor (const CallbackArg< T... > *cb)
template<class... T>
SafeFunctorArg< T... > | to_safe_functor (const CallbackArg< T... > *cb)
template<class T , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(FreeArgs...))
template<class T , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(FreeArgs...))
template<class T , class BoundArg , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg, FreeArgs...), BoundArg arg)
template<class T , class BoundArg , class Arg , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg, FreeArgs...), Arg &&arg)
template<class T , class BoundArg1 , class BoundArg2 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2)
template<class T , class BoundArg1 , class BoundArg2 , class Arg1 , class Arg2 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class Arg1 , class Arg2 , class Arg3 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8, BoundArg9 arg9)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8, Arg9 &&arg9)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8, BoundArg9 arg9, BoundArg10 arg10)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class Arg10 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8, Arg9 &&arg9, Arg10 &&arg10)
template<class T , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(FreeArgs...) const)
template<class T , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(FreeArgs...) const)
template<class T , class BoundArg , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg, FreeArgs...) const, BoundArg arg)
template<class T , class BoundArg , class Arg , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg, FreeArgs...) const, Arg &&arg)
template<class T , class BoundArg1 , class BoundArg2 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2)
template<class T , class BoundArg1 , class BoundArg2 , class Arg1 , class Arg2 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class Arg1 , class Arg2 , class Arg3 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8, BoundArg9 arg9)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8, Arg9 &&arg9)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) const, BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8, BoundArg9 arg9, BoundArg10 arg10)
template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class Arg10 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const T &t, void(T::*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) const, Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8, Arg9 &&arg9, Arg10 &&arg10)
template<class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(FreeArgs...))
template<class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(FreeArgs...))
template<class BoundArg , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg, FreeArgs...), BoundArg arg)
template<class BoundArg , class Arg , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg, FreeArgs...), Arg &&arg)
template<class BoundArg1 , class BoundArg2 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2)
template<class BoundArg1 , class BoundArg2 , class Arg1 , class Arg2 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class Arg1 , class Arg2 , class Arg3 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8, BoundArg9 arg9)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8, Arg9 &&arg9)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...), BoundArg1 arg1, BoundArg2 arg2, BoundArg3 arg3, BoundArg4 arg4, BoundArg5 arg5, BoundArg6 arg6, BoundArg7 arg7, BoundArg8 arg8, BoundArg9 arg9, BoundArg10 arg10)
template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class Arg10 , class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (void(*func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...), Arg1 &&arg1, Arg2 &&arg2, Arg3 &&arg3, Arg4 &&arg4, Arg5 &&arg5, Arg6 &&arg6, Arg7 &&arg7, Arg8 &&arg8, Arg9 &&arg9, Arg10 &&arg10)
template<class... FreeArgs>
CallbackArg< FreeArgs... > * | make (const std::function< void(FreeArgs...)> &f)
template<class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (const std::function< void(FreeArgs...)> &f)
template<class... FreeArgs>
CallbackArg< FreeArgs... > * | make (std::function< void(FreeArgs...)> &&f)
template<class... FreeArgs>
CallbackArg< FreeArgs... > * | make_ref (std::function< void(FreeArgs...)> &&f)
template<class... FreeArgs, class Lambda >
CallbackArg< FreeArgs... > * | lambda (Lambda &&l)
void | post (const Callback *cb, gint priority=G_PRIORITY_DEFAULT_IDLE, GMainContext *context=0)
void | post (const Callback *cb, Releaser &r, gint priority=G_PRIORITY_DEFAULT_IDLE, GMainContext *context=0)
template<class F , class = typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type, const Callback*>::value>::type>
void | post (F &&func, gint priority=G_PRIORITY_DEFAULT_IDLE, GMainContext *context=0)
template<class F , class = typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type, const Callback*>::value>::type>
void | post (F &&func, Releaser &r, gint priority=G_PRIORITY_DEFAULT_IDLE, GMainContext *context=0)

## Detailed Description

This namespace provides classes for type erasure.

#include <c++-gtk-utils/callback.h>

These classes provide type erasure on callable objects. They comprise a generic callback creation and execution interface for closures. There is a basic Callback::Callback type, which is an entire closure or 'thunk', where all values are bound into the object, and is completely opaque. Callback::CallbackArg<T...> is a class which takes unbound arguments of the template types when the object is dispatched. (The opaque Callback::Callback type is a typedef for Callback::CallbackArg<>: the two types are interchangeable.)

Objects of these classes are normally constructed using the Callback::lambda() factory function, which takes any callable object such as a lambda expression or the return value of std::bind, and returns a pointer to a Callback/CallbackArg object allocated on free store. When using Callback::lambda(), the unbound argument types (if any) must be passed as explicit template parameters.

Callback/CallbackArg objects can also be constructed using the Callback::make() and Callback::make_ref() factory functions, which can be useful where invoking standalone functions or object methods.

From version 2.2.6, a convenience Callback::to_unique() function is available which will construct a std::unique_ptr object from a Callback/CallbackArg object returned by Callback::lambda(), Callback::make() or Callback::make_ref(), for the purpose of taking ownership of the Callback/CallbackArg object. This function is mainly intended for use with the auto keyword, to avoid having to write out the type of the unique_ptr object in longhand. Corresponding Callback::to_functor() and Callback::to_safe_functor() functions are also provided.

The Callback/CallbackArg classes do not provide for a return value. If a result is wanted, users should pass an unbound argument by reference or pointer (or pointer to pointer).

## The Callback::make() and Callback::make_ref() functions

The Callback::make() and Callback::make_ref() functions construct a Callback/CallbackArg object from a function pointer (or an object reference and member function pointer) together with bound arguments. They provide for a maximum of five bound arguments, and the unbound arguments (if any) must be the last (trailing) arguments of the relevant function or method to be called. From version 2.2.10, if a suitable compiler is used (gcc >= 4.8 or clang >= 3.4), up to ten bound arguments are permitted - see further below.

Callback::make() does a direct type mapping from the bound arguments of the function or method represented by the callback object to the arguments stored by it and is for use when all bound arguments are simple fundamental types such as pointers (including C strings), integers or floating points.

Callback::make_ref() is for use where bound arguments include class types or one or more of the types of the bound arguments include a const reference. It will accomplish perfect forwarding (by lvalue reference or rvalue reference) when constructing the callback and will also ensure that a copy of any object to be passed by const reference (as well as any taken by value) is kept in order to avoid dangling references. Note however that where a member function is called, the object of which the target function is a member must still be in existence when the Callback/CallbackArg object is dispatched and, unlike Callback::make(), Callback::make_ref() cannot be used with overloaded functions except with explicit disambiguation.

Callback::make() can also construct a Callback/CallbackArg object from a std::function object.

As mentioned above, from version 2.2.10 if a suitable compiler is used (gcc >= 4.8 or clang >= 3.4), up to ten bound arguments are permitted instead of the previous maximum of five, by using a std::tuple backend for relevant callback classes. The tuple backend can be explicitly disabled with the --without-tuple configuration option (and it is implicitly disabled with gcc-4.6 and gcc-4.7), in which case the former backend employing the implementation used prior to version 2.2.10 is retained. For compilers other than gcc and clang which adequately support std::tuple, the tuple backend can be manually selected with the --with-tuple configuration option in place of the former backend. Both backends are ABI compatible, because for closure/callback implementation this library only exports the CallbackArg pure virtual class.

## Callback::FunctorArg and Callback::SafeFunctorArg classes

Functor/FunctorArg objects hold a Callback/CallbackArg object by SharedPtr to enable them to be shared by reference counting, and SafeFunctor/SafeFunctorArg objects hold them by SharedLockPtr, which have a thread safe reference count so that they may be shared between different threads. These classes also have an operator()() method so as to be callable with function syntax.

## Memory allocation

If the library is installed using the --with-glib-memory-slices-no-compat configuration option, any Callback/CallbackArg object will be constructed in glib memory slices rather than in the generic C++ free store.

## Usage

Using Callback::lambda():

using namespace Cgu;
// here cb1 is of type Callback::Callback*
auto cb1 = Callback::lambda<>([]() {std::cout << "Hello world\n";});
cb1->dispatch();
delete cb1;
// here Callback::to_unique() is used to make a std::unique_ptr object to
// manage the callback. cb2 is of type std::unique_ptr<const Callback::Callback>
auto cb2 = Callback::to_unique(Callback::lambda<>([]() {std::cout << "Hello world\n";}));
cb2->dispatch();
// the same using Callback::Functor
Callback::Functor f1{Callback::lambda<>([]() {std::cout << "Hello world\n";})};
f1();
int k = 5;
// here cb3 is of type std::unique_ptr<const Callback::CallbackArg<int, int&>>
auto cb3 = Callback::to_unique(Callback::lambda<int, int&>([=] (int i, int& j) {j = k * 10 * i;}));
int res;
cb3->dispatch(2, res);
std::cout << k << " times 10 times 2 is " << res << '\n';
// the same using Callback::FunctorArg
Callback::FunctorArg<int, int&> f2{Callback::lambda<int, int&>([=] (int i, int& j) {j = k * 10 * i;})};
f2(2, res);
std::cout << k << " times 10 times 2 is " << res << '\n';

Using Callback::make(), with a class object my_obj of type MyClass, with a method void MyClass::my_method(int, int, const char*):

using namespace Cgu;
int arg1 = 1, arg2 = 5;
// here cb1 is of type Callback::Callback*
auto cb1 = Callback::make(my_obj, &MyClass::my_method, arg1, arg2, "Hello\n");
cb1->dispatch();
delete cb1;
// here cb2 is of type std::unique_ptr<const Callback::Callback>
auto cb2 = Callback::to_unique(Callback::make(my_obj, &MyClass::my_method, arg1, arg2, "Hello\n"));
cb2->dispatch();
// the same using Callback::Functor
Callback::Functor f1{Callback::make(my_obj, &MyClass::my_method, arg1, arg2, "Hello\n")};
f1();
// here cb3 is of type std::unique_ptr<const Callback::CallbackArg<int, const char*>>
auto cb3 = Callback::to_unique(Callback::make(my_obj, &MyClass::my_method, arg1));
cb3->dispatch(arg2, "Hello\n");
// the same using Callback::FunctorArg
Callback::FunctorArg<int, const char*> f2{Callback::make(my_obj, &MyClass::my_method, arg1)};
f2(arg2, "Hello\n");

Using Callback::make_ref(), with a class object my_obj of type MyClass, with a method void MyClass::my_method(int, const Something&):

int arg1 = 1;
Something arg2;
// here cb is of type std::unique_ptr<const Callback::Callback>
auto cb = Callback::to_unique(Callback::make_ref(my_obj, &MyClass::my_method, arg1, arg2));

## Posting of callbacks

This namespace also provides a Callback::post() function which will execute a callback in a glib main loop and can be used (amongst other things) to pass an event from a worker thread to the main program thread. In that respect, it provides an alternative to the Notifier class. It is passed either a pointer to a Callback::Callback object created with a call to Callback::lambda() (or Callback::make() or Callback::make_ref()), or it can be passed a callable object and the implementation will call Callback::lambda() for you.

To provide for thread-safe automatic disconnection of the callback if the callback represents or calls into a non-static method of an object which may be destroyed before the callback executes in the main loop, include a Releaser as a public member of that object and pass the Releaser object as the second argument of Callback::post(). Note that for this to be race free, the lifetime of the remote object whose method is to be invoked must be determined by the thread to whose main loop the callback has been attached. When the main loop begins invoking the execution of the callback, the remote object must either wholly exist (in which case the callback will be invoked) or have been destroyed (in which case the callback will be ignored), and not be in some transient half-state governed by another thread.

Advantages as against Notifier:

1. If there are a lot of different events requiring callbacks to be dispatched in the program from worker threads to the main thread, this avoids having separate Notifier objects for each event.
2. It is easier to pass arguments with varying values - they can be passed as bound arguments of the callback and no special synchronisation is normally required (the call to g_source_attach() invokes locking of the main loop which will have the effect of ensuring memory visibility). With a Notifier object it may be necessary to use an asynchronous queue to pass variable values (or to bind a reference to the data, thus normally requiring separate synchronisation).
3. Although the callback would normally be sent for execution by the main program loop, and that is the default, it can be sent for execution by any thread which has its own GMainContext/GMainLoop objects. Thus callbacks can be passed for execution between worker threads, or from the main program thread to worker threads, as well as from worker threads to the main program thread.

Disadvantages as against Notifier:

1. Less efficient, as a new callback object has to be created on freestore every time the callback is invoked, together with a new SafeEmitter object if a Releaser is used to track the callback.
2. Multiple callbacks relevant to a single event cannot be invoked from a single call for the event - each callback has to be separately dispatched.

## Typedef Documentation

## ◆ Callback

typedef CallbackArg Cgu::Callback::Callback

## ◆ Functor

typedef FunctorArg Cgu::Callback::Functor

## ◆ SafeFunctor

typedef SafeFunctorArg Cgu::Callback::SafeFunctor

## Function Documentation

## ◆ lambda()

template<class... FreeArgs, class Lambda >

CallbackArg<FreeArgs...>* Cgu::Callback::lambda | ( | Lambda && | l | ) |

A convenience function to make Callback::CallbackArg objects from C++11/14 lambda expressions, or from any other arbitrary callable object. The types of the unbound arguments (if any) must be explicitly specified as template parameters, as they cannot be deduced. From version 2.0.10, this function can be called for lambda expressions which are declared mutable (in version 2.0.9, this function could only be called for non-mutable lambda expressions). From version 2.0.16, this function can be passed callable objects which are lvalues as well as rvalues (prior to version 2.0.16, it could only be passed callable objects which are rvalues).

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of an object captured by the lambda expression throws.

Since 2.0.9

## ◆ make() [1/35]

template<class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const std::function< void(FreeArgs...)> & | f | ) |

A convenience function to make Callback::CallbackArg objects from std::function objects.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [2/35]

template<class T , class BoundArg , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg, FreeArgs...) const | func,
|  | BoundArg | arg
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [3/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8,
|  | BoundArg9 | arg9,
|  | BoundArg10 | arg10
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [4/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8,
|  | BoundArg9 | arg9
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [5/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [6/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [7/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [8/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [9/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [10/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [11/35]

template<class T , class BoundArg1 , class BoundArg2 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, FreeArgs...) const | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [12/35]

template<class T , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | const T & | t,
|  | void(T::*)(FreeArgs...) const | func
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case. This exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option (instead glib will terminate the program if it is unable to obtain memory from the operating system).

## ◆ make() [13/35]

template<class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | std::function< void(FreeArgs...)> && | f | ) |

A convenience function to make Callback::CallbackArg objects from std::function objects.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [14/35]

template<class T , class BoundArg , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg, FreeArgs...) | func,
|  | BoundArg | arg
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [15/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8,
|  | BoundArg9 | arg9,
|  | BoundArg10 | arg10
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [16/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8,
|  | BoundArg9 | arg9
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [17/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [18/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [19/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [20/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [21/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [22/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [23/35]

template<class T , class BoundArg1 , class BoundArg2 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [24/35]

template<class T , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | T & | t,
|  | void(T::*)(FreeArgs...) | func
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case. This exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option (instead glib will terminate the program if it is unable to obtain memory from the operating system).

## ◆ make() [25/35]

template<class BoundArg , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg, FreeArgs...) | func,
|  | BoundArg | arg
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [26/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8,
|  | BoundArg9 | arg9,
|  | BoundArg10 | arg10
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [27/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8,
|  | BoundArg9 | arg9
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [28/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7,
|  | BoundArg8 | arg8
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [29/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6,
|  | BoundArg7 | arg7
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [30/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5,
|  | BoundArg6 | arg6
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make() [31/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4,
|  | BoundArg5 | arg5
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [32/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3,
|  | BoundArg4 | arg4
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [33/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2,
|  | BoundArg3 | arg3
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [34/35]

template<class BoundArg1 , class BoundArg2 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(BoundArg1, BoundArg2, FreeArgs...) | func,
|  | BoundArg1 | arg1,
|  | BoundArg2 | arg2
| ) |  |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make() [35/35]

template<class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make | ( | void(*)(FreeArgs...) | func | ) |

A convenience function to make Callback::CallbackArg objects

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case. This exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option (instead glib will terminate the program if it is unable to obtain memory from the operating system).

## ◆ make_ref() [1/35]

template<class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const std::function< void(FreeArgs...)> & | f | ) |

A convenience function to make Callback::Callback objects from std::function objects. Since this function takes no bound argument (and bound arguments are bound into the std::function object), it is a synonym for make() (the two are identical).

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy constructor of a bound argument throws and it is not a reference argument.

## ◆ make_ref() [2/35]

template<class T , class BoundArg , class Arg , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg, FreeArgs...) const | func,
|  | Arg && | arg
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [3/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class Arg10 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8,
|  | Arg9 && | arg9,
|  | Arg10 && | arg10
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [4/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8,
|  | Arg9 && | arg9
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [5/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [6/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [7/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [8/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [9/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [10/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class Arg1 , class Arg2 , class Arg3 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [11/35]

template<class T , class BoundArg1 , class BoundArg2 , class Arg1 , class Arg2 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, FreeArgs...) const | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [12/35]

template<class T , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | const T & | t,
|  | void(T::*)(FreeArgs...) const | func
| ) |  |

Since this function constructs a callback which does not take a bound argument, it is a synonym for make() (the two are identical).

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case. This exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option (instead glib will terminate the program if it is unable to obtain memory from the operating system).

Since 2.0.0-rc3

## ◆ make_ref() [13/35]

template<class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | std::function< void(FreeArgs...)> && | f | ) |

A convenience function to make Callback::Callback objects from std::function objects. Since this function takes no bound argument (and bound arguments are bound into the std::function object), it is a synonym for make() (the two are identical).

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws and it is not a reference argument.

## ◆ make_ref() [14/35]

template<class T , class BoundArg , class Arg , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg, FreeArgs...) | func,
|  | Arg && | arg
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [15/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class Arg10 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8,
|  | Arg9 && | arg9,
|  | Arg10 && | arg10
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [16/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8,
|  | Arg9 && | arg9
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [17/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [18/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [19/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [20/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [21/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [22/35]

template<class T , class BoundArg1 , class BoundArg2 , class BoundArg3 , class Arg1 , class Arg2 , class Arg3 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [23/35]

template<class T , class BoundArg1 , class BoundArg2 , class Arg1 , class Arg2 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(BoundArg1, BoundArg2, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [24/35]

template<class T , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | T & | t,
|  | void(T::*)(FreeArgs...) | func
| ) |  |

Since this function constructs a callback which does not take a bound argument, it is a synonym for make() (the two are identical).

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case. This exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option (instead glib will terminate the program if it is unable to obtain memory from the operating system).

Since 2.0.0-rc3

## ◆ make_ref() [25/35]

template<class BoundArg , class Arg , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg, FreeArgs...) | func,
|  | Arg && | arg
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [26/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class BoundArg10 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class Arg10 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, BoundArg10, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8,
|  | Arg9 && | arg9,
|  | Arg10 && | arg10
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [27/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class BoundArg9 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class Arg9 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, BoundArg9, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8,
|  | Arg9 && | arg9
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [28/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class BoundArg8 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class Arg8 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, BoundArg8, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7,
|  | Arg8 && | arg8
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [29/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class BoundArg7 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class Arg7 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, BoundArg7, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6,
|  | Arg7 && | arg7
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [30/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class BoundArg6 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class Arg6 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, BoundArg6, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5,
|  | Arg6 && | arg6
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Note
  More than 5 bound values may not be passed to this function unless either (i) this library is compiled with gcc >= 4.8 or clang >= 3.4, or (ii) the library is compiled by another compiler with appropriate support for C++11 tuples using the --with-tuple configuration option.

Since 2.2.10

## ◆ make_ref() [31/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class BoundArg5 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class Arg5 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4,
|  | Arg5 && | arg5
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [32/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class BoundArg4 , class Arg1 , class Arg2 , class Arg3 , class Arg4 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3,
|  | Arg4 && | arg4
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [33/35]

template<class BoundArg1 , class BoundArg2 , class BoundArg3 , class Arg1 , class Arg2 , class Arg3 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2,
|  | Arg3 && | arg3
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [34/35]

template<class BoundArg1 , class BoundArg2 , class Arg1 , class Arg2 , class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(BoundArg1, BoundArg2, FreeArgs...) | func,
|  | Arg1 && | arg1,
|  | Arg2 && | arg2
| ) |  |

An alternative function to make Callback::CallbackArg objects, which is for use where a target function either receives a class type bound argument by value, or receives a bound argument by reference to const in a case where the generated CallbackArg object is to store a copy of that argument instead of just keeping a reference.

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system). It will also throw if the copy or move constructor of a bound argument throws.

Since 2.0.0-rc3

## ◆ make_ref() [35/35]

template<class... FreeArgs>

CallbackArg<FreeArgs...>* Cgu::Callback::make_ref | ( | void(*)(FreeArgs...) | func | ) |

Since this function constructs a callback which does not take a bound argument, it is a synonym for make() (the two are identical).

Exceptions

  std::bad_alloc | It might throw std::bad_alloc if memory is exhausted and the system throws in that case. This exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option (instead glib will terminate the program if it is unable to obtain memory from the operating system).

Since 2.0.0-rc3

## ◆ operator!=() [1/2]

template<class... T>

bool Cgu::Callback::operator!= | ( | const FunctorArg< T... > & | f1,
|  | const FunctorArg< T... > & | f2
| ) |  |
| noexcept

Two FunctorArg objects compare unequal if the addresses of the CallbackArg objects they contain are not the same. This comparison operator does not throw.

## ◆ operator!=() [2/2]

template<class... T>

bool Cgu::Callback::operator!= | ( | const SafeFunctorArg< T... > & | f1,
|  | const SafeFunctorArg< T... > & | f2
| ) |  |
| noexcept

Two SafeFunctorArg objects compare unequal if the addresses of the CallbackArg objects they contain are not the same. This comparison operator does not throw.

## ◆ operator<() [1/2]

template<class... T>

bool Cgu::Callback::operator< | ( | const FunctorArg< T... > & | f1,
|  | const FunctorArg< T... > & | f2
| ) |  |

One FunctorArg object is less than another if the address of the CallbackArg object contained by the first is regarded by std::less as less than the address of the CallbackArg object contained by the other. This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation).

## ◆ operator<() [2/2]

template<class... T>

bool Cgu::Callback::operator< | ( | const SafeFunctorArg< T... > & | f1,
|  | const SafeFunctorArg< T... > & | f2
| ) |  |

One SafeFunctorArg object is less than another if the address of the CallbackArg object contained by the first is regarded by std::less as less than the address of the CallbackArg object contained by the other. This comparison operator does not throw unless std::less applied to pointer types throws (which it would not do with any sane implementation).

## ◆ operator==() [1/2]

template<class... T>

bool Cgu::Callback::operator== | ( | const FunctorArg< T... > & | f1,
|  | const FunctorArg< T... > & | f2
| ) |  |
| noexcept

Two FunctorArg objects compare equal if the addresses of the CallbackArg objects they contain are the same. This comparison operator does not throw.

## ◆ operator==() [2/2]

template<class... T>

bool Cgu::Callback::operator== | ( | const SafeFunctorArg< T... > & | f1,
|  | const SafeFunctorArg< T... > & | f2
| ) |  |
| noexcept

Two SafeFunctorArg objects compare equal if the addresses of the CallbackArg objects they contain are the same. This comparison operator does not throw.

## ◆ post() [1/4]

void Cgu::Callback::post | ( | const Callback * | cb,
|  | gint | priority = `G_PRIORITY_DEFAULT_IDLE`,
|  | GMainContext * | context = `0`
| ) |  |

Posts a callback for execution by a glib main loop. It is thread-safe provided that (if glib < 2.32 is used) g_thread_init() has been called. glib >= 2.32 does not require g_thread_init() to be called. This function will not throw.

Parameters

  cb | The callback object. Ownership is taken of this object, and it will be deleted when it has been finished with.
  priority | The priority to be given to the callback in the main loop. In ascending order of priorities, priorities are G_PRIORITY_LOW, G_PRIORITY_DEFAULT_IDLE, G_PRIORITY_HIGH_IDLE, G_PRIORITY_DEFAULT and G_PRIORITY_HIGH. The default is G_PRIORITY_DEFAULT_IDLE. This determines the order in which the callback will appear in the event list in the main loop, not the priority which the OS will adopt
  context | The glib main loop context in which the callback is to be executed (the default of NULL will cause the callback to be executed in the main program loop, and this is usually what is wanted).

Note
  1. Cancellation of the receiving thread is blocked when the callback executes.
  2. If the callback throws an exception, the exception will be consumed to protect the main loop and a g_critical() warning will be issued.

## ◆ post() [2/4]

void Cgu::Callback::post | ( | const Callback * | cb,
|  | Releaser & | r,
|  | gint | priority = `G_PRIORITY_DEFAULT_IDLE`,
|  | GMainContext * | context = `0`
| ) |  |

Posts a callback for execution by a glib main loop. It is thread-safe provided that (if glib < 2.32 is used) g_thread_init() has been called. glib >= 2.32 does not require g_thread_init() to be called. This function will not throw.

Parameters

  cb | The callback object. Ownership is taken of this object, and it will be deleted when it has been finished with.
  r | A Releaser object for automatic disconnection of the callback before it executes in the main loop (mainly relevant if the callback represents a non-static member function of an object which may be destroyed before the callback executes).
  priority | The priority to be given to the callback in the main loop. In ascending order of priorities, priorities are G_PRIORITY_LOW, G_PRIORITY_DEFAULT_IDLE, G_PRIORITY_HIGH_IDLE, G_PRIORITY_DEFAULT and G_PRIORITY_HIGH. The default is G_PRIORITY_DEFAULT_IDLE. This determines the order in which the callback will appear in the event list in the main loop, not the priority which the OS will adopt.
  context | The glib main loop context in which the callback is to be executed (the default of NULL will cause the callback to be executed in the main program loop, and this is usually what is wanted).

Exceptions

  std::bad_alloc | This function might throw std::bad_alloc if memory is exhausted and the system throws in that case. If it does so, the Callback object will be disposed of.
  Cgu::Thread::MutexError | This function might throw Cgu:Thread::MutexError if initialisation of the mutex in a SafeEmitterArg object constructed by this function fails. If it does so, the Callback object will be disposed of. (It is often not worth checking for this exception, as it means either memory is exhausted or pthread has run out of other resources to create new mutexes.)

Note
  1. Cancellation of the receiving thread is blocked when the callback executes.
  2. If the callback throws an exception, the exception will be consumed to protect the main loop and a g_critical() warning will be issued.
  3. By virtue of the Releaser object, it is in theory possible (if memory is exhausted and the system throws in that case) that an internal SafeEmitterArg object will throw std::bad_alloc when emitting/executing the callback in the glib main loop, with the result that the relevant callback will not execute (instead the exception will be consumed and a g_critical() warning will be issued). This is rarely of any relevance because glib will abort the program if it is itself unable to obtain memory from the operating system. However, where it is relevant, design the program so that it is not necessary to provide a releaser object.

## ◆ post() [3/4]

template<class F , class = typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type, const Callback*>::value>::type>

void Cgu::Callback::post | ( | F && | func,
|  | gint | priority = `G_PRIORITY_DEFAULT_IDLE`,
|  | GMainContext * | context = `0`
| ) |  |

Posts a callable object for execution by a glib main loop. It is thread-safe provided that (if glib < 2.32 is used) g_thread_init() has been called. glib >= 2.32 does not require g_thread_init() to be called.

Parameters

  func | A callable object, such as formed by a lambda expression or the result of std::bind. It must be fully bound (that is, its must take no arguments when called).
  priority | The priority to be given to the callable object in the main loop. In ascending order of priorities, priorities are G_PRIORITY_LOW, G_PRIORITY_DEFAULT_IDLE, G_PRIORITY_HIGH_IDLE, G_PRIORITY_DEFAULT and G_PRIORITY_HIGH. The default is G_PRIORITY_DEFAULT_IDLE. This determines the order in which the callback will appear in the event list in the main loop, not the priority which the OS will adopt
  context | The glib main loop context in which the callable object is to be executed (the default of NULL will cause the callback to be executed in the main program loop, and this is usually what is wanted).

Exceptions

  std::bad_alloc | This function might throw std::bad_alloc if memory is exhausted and the system throws in that case (this exception will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system).

Note
  1. This function may also throw if the copy or move constructor of the callable object throws.
  2. Cancellation of the receiving thread is blocked when the callback executes.
  3. If the callback throws an exception, the exception will be consumed to protect the main loop and a g_critical() warning will be issued.

Since 2.1.0

## ◆ post() [4/4]

template<class F , class = typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type, const Callback*>::value>::type>

void Cgu::Callback::post | ( | F && | func,
|  | Releaser & | r,
|  | gint | priority = `G_PRIORITY_DEFAULT_IDLE`,
|  | GMainContext * | context = `0`
| ) |  |

Posts a callable object for execution by a glib main loop. It is thread-safe provided that (if glib < 2.32 is used) g_thread_init() has been called. glib >= 2.32 does not require g_thread_init() to be called.

Parameters

  func | A callable object, such as formed by a lambda expression or the result of std::bind. It must be fully bound (that is, its must take no arguments when called).
  r | A Releaser object for automatic disconnection of the callback before it executes in the main loop (mainly relevant if the callback represents or calls into a non-static member function of an object which may be destroyed before the callback executes).
  priority | The priority to be given to the callback in the main loop. In ascending order of priorities, priorities are G_PRIORITY_LOW, G_PRIORITY_DEFAULT_IDLE, G_PRIORITY_HIGH_IDLE, G_PRIORITY_DEFAULT and G_PRIORITY_HIGH. The default is G_PRIORITY_DEFAULT_IDLE. This determines the order in which the callback will appear in the event list in the main loop, not the priority which the OS will adopt.
  context | The glib main loop context in which the callable object is to be executed (the default of NULL will cause the callback to be executed in the main program loop, and this is usually what is wanted).

Exceptions

  std::bad_alloc | This function might throw std::bad_alloc if memory is exhausted and the system throws in that case.
  Cgu::Thread::MutexError | This function might throw Cgu:Thread::MutexError if initialisation of the mutex in a SafeEmitterArg object constructed by this function fails. (It is often not worth checking for this exception, as it means either memory is exhausted or pthread has run out of other resources to create new mutexes.)

Note
  1. This function may also throw if the copy or move constructor of the callable object throws.
  2. Cancellation of the receiving thread is blocked when the callback executes.
  3. If the callback throws an exception, the exception will be consumed to protect the main loop and a g_critical() warning will be issued.
  4. By virtue of the Releaser object, it is in theory possible (if memory is exhausted and the system throws in that case) that an internal SafeEmitterArg object will throw std::bad_alloc when emitting/executing the callback in the glib main loop, with the result that the relevant callback will not execute (instead the exception will be consumed and a g_critical() warning will be issued). This is rarely of any relevance because glib will abort the program if it is itself unable to obtain memory from the operating system. However, where it is relevant, design the program so that it is not necessary to provide a releaser object.

Since 2.1.0

## ◆ to_functor()

template<class... T>

FunctorArg<T...> Cgu::Callback::to_functor | ( | const CallbackArg< T... > * | cb | ) |

A function for making a Cgu::Callback::FunctorArg object from a Cgu::Callback::CallbackArg object, for the purpose of taking ownership of the CallbackArg object. It is thread safe.

Because the constructor of FunctorArg taking a pointer is not explicit and can therefore be used for implicit type conversion, this function will not often be needed. It is mainly intended for use when constructing a named object in local scope with the auto keyword, to avoid having to write out the type of the FunctorArg object in longhand. For example:

using namespace Cgu;
// here a Cgu::Callback::FunctorArg<const std::string&> object is constructed
auto f = Callback::to_functor(Callback::lambda<const std::string&>([] (const std::string& s) {
std::cout << s;
}));
f("Hello\n");

Parameters

  cb | The CallbackArg object which is to be managed by a functor.

Returns
  The FunctorArg object.

Exceptions

  std::bad_alloc | This function might throw std::bad_alloc if memory is exhausted and the system throws in that case. Note that if such an exception is thrown, then this function will delete the callback object passed to it.

Note
  std::bad_alloc will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system.

Since 2.0.23 and 2.2.6

## ◆ to_safe_functor()

template<class... T>

SafeFunctorArg<T...> Cgu::Callback::to_safe_functor | ( | const CallbackArg< T... > * | cb | ) |

A function for making a Cgu::Callback::SafeFunctorArg object from a Cgu::Callback::CallbackArg object, for the purpose of taking ownership of the CallbackArg object. It is thread safe.

Because the constructor of SafeFunctorArg taking a pointer is not explicit and can therefore be used for implicit type conversion, this function will not often be needed. It is mainly intended for use when constructing a named object in local scope with the auto keyword, to avoid having to write out the type of the SafeFunctorArg object in longhand. For example:

using namespace Cgu;
// here a Cgu::Callback::SafeFunctorArg<const std::string&> object is constructed
auto f = Callback::to_safe_functor(Callback::lambda<const std::string&>([] (const std::string& s) {
std::cout << s;
}));
f("Hello\n");

Parameters

  cb | The CallbackArg object which is to be managed by a functor.

Returns
  The SafeFunctorArg object.

Exceptions

  std::bad_alloc | This function might throw std::bad_alloc if memory is exhausted and the system throws in that case. Note that if such an exception is thrown, then this function will delete the callback object passed to it.

Note
  std::bad_alloc will not be thrown if the library has been installed using the --with-glib-memory-slices-no-compat configuration option: instead glib will terminate the program if it is unable to obtain memory from the operating system.

Since 2.0.23 and 2.2.6

## ◆ to_unique()

template<class... T>

std::unique_ptr<const CallbackArg<T...> > Cgu::Callback::to_unique | ( | const CallbackArg< T... > * | cb | ) |
| noexcept

A function for making a std::unique_ptr object from a Cgu::Callback::CallbackArg object (say, as constructed by Cgu::Callback::lambda(), Cgu::Callback::make() or Cgu::Callback::make_ref()), for the purpose of taking ownership of the CallbackArg object. It is thread safe and will not throw.

This function is mainly intended for use with the auto keyword, to avoid having to write out the type of the unique_ptr object in longhand. For example:

using namespace Cgu;
// here a std::unique_ptr<const Cgu::Callback::CallbackArg<const std::string&>> object is constructed
auto cb = Callback::to_unique(Callback::lambda<const std::string&>([] (const std::string& s) {
std::cout << s;
}));
cb->dispatch("Hello\n");

This function cannot be used to overcome the problems of C++'s unconstrained partial evaluation rules for functions taking more than one argument (the lack of such constraints is a poor design choice for a language with exceptions such as C++). For example, a function:

void do_it(std::unique_ptr<const Cgu::Callback::Callback> cb1,
std::unique_ptr<const Cgu::Callback::Callback> cb2);

should not be called like this:

do_it(Callback::to_unique(Callback::lambda<>([]() {...;})),
Callback::to_unique(Callback::lambda<>([]() {...;})));

This is because one possible sequencing that C++ permits is as follows:

1. Construct the callback object for the first argument by calling Callback::lambda().
2. Construct the callback object for the second argument by calling Callback::lambda().
3. Initialize a std::unique_ptr object for the second argument by calling Callback::to_unique().
4. Initialize a std::unique_ptr object for the first argument by calling Callback::to_unique().
5. Enter do_it().

Because step 2 is permitted to precede step 4, if step 2 throws then the object constructed at step 1 will be leaked. To avoid this, explicit sequencing must be provided for in the code, as follows:

auto cb1 = Callback::to_unique(Callback::lambda<>([]() {...;}));
auto cb2 = Callback::to_unique(Callback::lambda<>([]() {...;}));
do_it(std::move(cb1),
std::move(cb2));

The Cgu::Callback::CallbackArg object held by the unique_ptr returned by this function is const. This is because all the interfaces in this library also take const Cgu::Callback::CallbackArg objects (and their only method, the dispatch() method, is const). However, if constructed using Cgu::Callback::lambda(), Cgu::Callback::make() or Cgu::Callback::make_ref(), the Cgu::Callback::CallbackArg object can safely be cast to non-const.

Parameters

  cb | The CallbackArg object which is to be managed by a std::unique_ptr.

Returns
  The std::unique_ptr object.

Since 2.0.23 and 2.2.6

Cgu::Callback::make_ref
CallbackArg< FreeArgs... > * make_ref(T &t, void(T::*func)(FreeArgs...))
Definition: callback.h:1352
Cgu
Definition: application.h:44
Cgu::Callback::make
CallbackArg< FreeArgs... > * make(T &t, void(T::*func)(FreeArgs...))
Definition: callback.h:1334
Cgu::Callback::to_functor
FunctorArg< T... > to_functor(const CallbackArg< T... > *cb)
Definition: callback.h:1212
Cgu::Callback::to_safe_functor
SafeFunctorArg< T... > to_safe_functor(const CallbackArg< T... > *cb)
Definition: callback.h:1252
Cgu::Callback::to_unique
std::unique_ptr< const CallbackArg< T... > > to_unique(const CallbackArg< T... > *cb) noexcept
Definition: callback.h:771
Cgu::Callback::FunctorArg
Functor class holding a Callback::CallbackArg object.
Definition: callback.h:777