invoke function should return void as signal handlers can't return anything anyway

0.8
Bruno Van de Velde 2017-08-30 23:30:12 +02:00
parent 348ed0f580
commit a1a5c89bd2
1 changed files with 4 additions and 4 deletions

View File

@ -598,15 +598,15 @@ namespace tgui
// std::invoke only exists in c++17 so we use our own implementation to support c++14 compilers
// Visual Studio compiler did not like it when the function was called "invoke"
template <typename Func, typename... Args, typename std::enable_if<std::is_member_pointer<typename std::decay<Func>::type>::value>::type* = nullptr>
TGUI_CONSTEXPR decltype(auto) invokeFunc(Func&& func, Args&&... args)
void invokeFunc(Func&& func, Args&&... args)
{
return std::mem_fn(func)(std::forward<Args>(args)...);
std::mem_fn(func)(std::forward<Args>(args)...);
}
template <typename Func, typename... Args, typename std::enable_if<!std::is_member_pointer<typename std::decay<Func>::type>::value>::type* = nullptr>
TGUI_CONSTEXPR decltype(auto) invokeFunc(Func&& func, Args&&... args)
void invokeFunc(Func&& func, Args&&... args)
{
return std::forward<Func>(func)(std::forward<Args>(args)...);
std::forward<Func>(func)(std::forward<Args>(args)...);
}
// The binder will figure out the unbound parameters and bind them if they correspond to what the signal sends