Replace coral::callable
with coral::closure
#9
|
@ -440,6 +440,14 @@ export namespace coral {
|
|||
this->context = callable_function;
|
||||
}
|
||||
|
||||
template<typename functor> closure(functor * callable_functor) {
|
||||
this->dispatch = [](void const * context, arguments... dispatch_arguments) -> returns {
|
||||
return (*reinterpret_cast<functor const*>(context))(dispatch_arguments...);
|
||||
};
|
||||
|
||||
this->context = callable_functor;
|
||||
}
|
||||
|
||||
closure(closure const &) = delete;
|
||||
|
||||
template<typename functor> closure(functor && callable_functor) {
|
||||
|
|
Loading…
Reference in New Issue