Skip to content

Commit

Permalink
Only permit implicit conversions of return type
Browse files Browse the repository at this point in the history
  • Loading branch information
muggenhor committed Nov 27, 2017
1 parent 62de5de commit e524d18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions callback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace util
typename std::enable_if<is_callable<F, Args...>::value && !is_callback<F>::value, callback_ret<R>>::type
static do_invoke(F&& f, Args&&... args)
{
return static_cast<R>(std::forward<F>(f)(std::forward<Args>(args)...));
return std::forward<F>(f)(std::forward<Args>(args)...);
}

template <typename F, typename... Args>
Expand Down Expand Up @@ -158,7 +158,7 @@ namespace util
template <typename FR, typename O, typename... Args>
static callback_ret<R> do_invoke(O* that, FR O::* f, Args&&... args)
{
return static_cast<R>((that->*f)(std::forward<Args>(args)...));
return (that->*f)(std::forward<Args>(args)...);
}
};

Expand Down

0 comments on commit e524d18

Please sign in to comment.