diff --git a/source/coral.cpp b/source/coral.cpp index 7839d95..5c70cc0 100644 --- a/source/coral.cpp +++ b/source/coral.cpp @@ -440,6 +440,14 @@ export namespace coral { this->context = callable_function; } + template closure(functor * callable_functor) { + this->dispatch = [](void const * context, arguments... dispatch_arguments) -> returns { + return (*reinterpret_cast(context))(dispatch_arguments...); + }; + + this->context = callable_functor; + } + closure(closure const &) = delete; template closure(functor && callable_functor) {