diff --git a/include/functional_unwrap.hpp b/include/functional_unwrap.hpp index 4584f4e..1be4613 100644 --- a/include/functional_unwrap.hpp +++ b/include/functional_unwrap.hpp @@ -26,6 +26,7 @@ #include #include +#include namespace fu { @@ -170,6 +171,14 @@ namespace fu struct is_unwrappable : decltype(detail::test_unwrappable(0)) { }; + /// Converts any functional type in std::function. + template + auto functionfy(Functional&& functional) + -> function_type_of_t::type> + { + return function_type_of_t::type>(std::forward(functional)); + } + template struct requires_functional_constructible {