32 #ifndef VSMC_GCD_DISPATCH_FUNCTION_HPP
33 #define VSMC_GCD_DISPATCH_FUNCTION_HPP
36 #include <dispatch/dispatch.h>
58 #if VSMC_HAS_CXX11_RVALUE_REFERENCES
62 void *
context () {
return static_cast<void *
>(
this);}
64 ::dispatch_function_t
function ()
const {
return function_;}
70 static void function_ (
void *ctx)
77 #if VSMC_HAS_CXX11_RVALUE_REFERENCES
83 inline DispatchFunction<
84 typename cxx11::remove_cv<typename cxx11::remove_reference<T>::type>
::type>
94 {
return new DispatchFunction<T>(work);}
99 #endif // VSMC_GCD_DISPATCH_FUNCTION_HPP
Wrap a callable object into a dispatch_function_t type pointer.
DispatchFunction(T &&work) noexcept
DispatchFunction(const T &work)
remove_reference< T >::type && move(T &&t) noexcept
#define VSMC_NOEXCEPT
noexcept
DispatchFunction< typename cxx11::remove_cv< typename cxx11::remove_reference< T >::type >::type > * dispatch_function_new(T &&work) noexcept
Make a DispatchFunction object from an arbitrary callable object.
remove_volatile< typename remove_const< T >::type >::type type