diff options
Diffstat (limited to 'webm_parser/src/master_parser.h')
-rw-r--r-- | webm_parser/src/master_parser.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/webm_parser/src/master_parser.h b/webm_parser/src/master_parser.h index 2000167..d3ca7c7 100644 --- a/webm_parser/src/master_parser.h +++ b/webm_parser/src/master_parser.h @@ -147,17 +147,20 @@ class MasterParser : public ElementParser { /* clang-format on */ }; - using StdHashId = std::hash<std::underlying_type<Id>::type>; + using StdHashIdKeyType = std::underlying_type<Id>::type; + using StdHashId = std::hash<StdHashIdKeyType>; // Hash functor for hashing Id enums for storage in std::unordered_map. struct IdHash : StdHashId { - // Type aliases for conforming to the std::hash interface. - using argument_type = Id; +#if __cpp_lib_is_invocable + using result_type = std::invoke_result<StdHashId, StdHashIdKeyType>::type; +#else using result_type = StdHashId::result_type; +#endif // __cpp_lib_is_invocable // Returns the hash of the given id. - result_type operator()(argument_type id) const { - return StdHashId::operator()(static_cast<StdHashId::argument_type>(id)); + result_type operator()(Id id) const { + return StdHashId::operator()(static_cast<StdHashIdKeyType>(id)); } }; |