From 1e1679ffe030b40f9689c36ff42bbb8eae715c4b Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 24 Nov 2020 23:10:15 +0300 Subject: [PATCH] Add include in util::function for std::invoke --- libs/util/include/psemek/util/function.hpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libs/util/include/psemek/util/function.hpp b/libs/util/include/psemek/util/function.hpp index 14d9b523..06e5041d 100644 --- a/libs/util/include/psemek/util/function.hpp +++ b/libs/util/include/psemek/util/function.hpp @@ -2,18 +2,11 @@ #include #include +#include namespace psemek::util { - namespace detail - { - - // Implemented in cpp to prevent dependency on - [[noreturn]] void bad_function_call(); - - } - template struct function; @@ -154,7 +147,7 @@ namespace psemek::util R function::operator()(Args1 && ... args) const { if (!vtable_) - detail::bad_function_call(); + throw std::bad_function_call(); return vtable_->call(const_cast(static_cast(&storage_)), std::forward(args)...); }