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)...); }