Skip to content

Commit

Permalink
Change std::result_of<> for std::invoke_result<>
Browse files Browse the repository at this point in the history
std::result_of<> has been deprecated in C++17 and removed in C++20
  • Loading branch information
Yohan Simard committed May 1, 2021
1 parent e2b8d62 commit ae80f00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lager/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ struct dispatcher<actions<Actions...>> : std::function<void(Actions)>...
Converter conv)
{
auto& other = static_cast<std::function<void(
find_convertible_action_t<std::result_of_t<Converter(Action)>,
find_convertible_action_t<std::invoke_result_t<Converter, Action>,
As...>)>&>(other_);
return [conv, other](auto&& act) { other(conv(LAGER_FWD(act))); };
}
Expand Down
8 changes: 4 additions & 4 deletions lager/sensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class sensor_node_base : public root_node<T, reader_node>

template <typename SensorFnT>
class sensor_node
: public sensor_node_base<std::decay_t<std::result_of_t<SensorFnT()>>>
: public sensor_node_base<std::decay_t<std::invoke_result_t<SensorFnT>>>
{
using base_t =
sensor_node_base<std::decay_t<std::result_of_t<SensorFnT()>>>;
sensor_node_base<std::decay_t<std::invoke_result_t<SensorFnT>>>;

public:
sensor_node(SensorFnT sensor)
Expand Down Expand Up @@ -70,7 +70,7 @@ class sensor : public reader_base<detail::sensor_node_base<T>>
template <
typename Fn,
std::enable_if_t<
std::is_same_v<std::decay_t<std::result_of_t<Fn()>>, value_type>,
std::is_same_v<std::decay_t<std::invoke_result_t<Fn>>, value_type>,
int> = 0>
sensor(Fn&& fn)
: base_t{detail::make_sensor_node(std::forward<Fn>(fn))}
Expand All @@ -83,7 +83,7 @@ class sensor : public reader_base<detail::sensor_node_base<T>>

template <typename SensorFnT>
auto make_sensor(SensorFnT&& fn)
-> sensor<std::decay_t<std::result_of_t<SensorFnT()>>>
-> sensor<std::decay_t<std::invoke_result_t<SensorFnT>>>
{
return std::forward<SensorFnT>(fn);
}
Expand Down

0 comments on commit ae80f00

Please sign in to comment.