diff --git a/src/backend/thread-wrapper.hpp b/src/backend/thread-wrapper.hpp index 42e9b9246..f6b264906 100644 --- a/src/backend/thread-wrapper.hpp +++ b/src/backend/thread-wrapper.hpp @@ -42,6 +42,7 @@ #include "lib/error.hpp" #include "include/logging.h" +#include "lib/meta/function.hpp" #include "lib/result.hpp" extern "C" { @@ -50,14 +51,11 @@ extern "C" { #include "backend/threadpool-init.hpp" #include -#include #include namespace backend { - using std::bind; - using std::function; using lib::Literal; namespace error = lumiera::error; using error::LUMIERA_ERROR_STATE; @@ -125,7 +123,8 @@ namespace backend { static void threadMain (void* arg) { - function _doIt_{forwardInitialiser (arg)}; + using Fun= typename lib::meta::_Fun::Functor; + Fun _doIt_{forwardInitialiser (arg)}; lumiera_thread_sync (); // sync point: arguments handed over diff --git a/src/lib/meta/function.hpp b/src/lib/meta/function.hpp index 8a268aa62..9e6d9fe6f 100644 --- a/src/lib/meta/function.hpp +++ b/src/lib/meta/function.hpp @@ -104,13 +104,17 @@ namespace meta{ template struct _Fun : std::false_type - { }; + { + using Functor = FUN; + }; /** Specialisation for function objects and lambdas */ template struct _Fun> > : _Fun - { }; + { + using Functor = FUN; + }; /** Specialisation for a bare function signature */ template @@ -120,6 +124,7 @@ namespace meta{ using Ret = RET; using Args = Types; using Sig = RET(ARGS...); + using Functor = std::function; }; /** Specialisation for using a function pointer */ template