Skip to content

Commit 7dee3b8

Browse files
author
Steven WdV
committed
Fix C++20 compatibility
Closes #602
1 parent 761b932 commit 7dee3b8

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Rx/v2/src/rxcpp/rx-util.hpp

+4-12
Original file line numberDiff line numberDiff line change
@@ -996,22 +996,16 @@ struct filtered_hash<T, typename std::enable_if<rxu::is_string<T>::value>::type>
996996
};
997997
template <class T>
998998
struct filtered_hash<T, typename std::enable_if<std::is_convertible<T, std::chrono::duration<typename T::rep, typename T::period>>::value>::type> {
999-
using argument_type = T;
1000-
using result_type = std::size_t;
1001-
1002-
result_type operator()(argument_type const & dur) const
999+
std::size_t operator()(T const & dur) const
10031000
{
1004-
return std::hash<typename argument_type::rep>{}(dur.count());
1001+
return std::hash<typename T::rep>{}(dur.count());
10051002
}
10061003
};
10071004
template <class T>
10081005
struct filtered_hash<T, typename std::enable_if<std::is_convertible<T, std::chrono::time_point<typename T::clock, typename T::duration>>::value>::type> {
1009-
using argument_type = T;
1010-
using result_type = std::size_t;
1011-
1012-
result_type operator()(argument_type const & tp) const
1006+
std::size_t operator()(T const & tp) const
10131007
{
1014-
return std::hash<typename argument_type::rep>{}(tp.time_since_epoch().count());
1008+
return std::hash<typename T::rep>{}(tp.time_since_epoch().count());
10151009
}
10161010
};
10171011

@@ -1022,8 +1016,6 @@ struct is_hashable
10221016
template<typename T>
10231017
struct is_hashable<T,
10241018
typename rxu::types_checked_from<
1025-
typename filtered_hash<T>::result_type,
1026-
typename filtered_hash<T>::argument_type,
10271019
typename rxu::callable_result<filtered_hash<T>, T>::type>::type>
10281020
: std::true_type {};
10291021

0 commit comments

Comments
 (0)