diff options
author | Gabriel Dos Reis <GabrielDosReis@users.noreply.github.com> | 2022-08-17 00:20:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 00:20:19 -0700 |
commit | f9a884706ac7e0f92db5e6cb16811d543a98ac28 (patch) | |
tree | 8c6731dea814bb153bdf9ef772186145970492fd | |
parent | df38376232d71863f7807577edfe0f3e5995aaca (diff) | |
parent | d439c3aa737e9a35de4699c2612c68d104013cae (diff) | |
download | open-axiom-f9a884706ac7e0f92db5e6cb16811d543a98ac28.tar.gz |
Merge pull request #15 from GabrielDosReis/gdr/hash-function-result
Stop referencing `std::hash<T>::result_type`
-rw-r--r-- | src/include/open-axiom/Lisp | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/include/open-axiom/Lisp b/src/include/open-axiom/Lisp index dff5c769..5b34242a 100644 --- a/src/include/open-axiom/Lisp +++ b/src/include/open-axiom/Lisp @@ -46,25 +46,22 @@ #include <iosfwd> #include <unordered_set> -namespace std { - template<> - struct hash<OpenAxiom::VM::Package> { - hash<OpenAxiom::VM::String>::result_type - operator()(const OpenAxiom::VM::Package& s) const { - return h(s.name); - } - hash<OpenAxiom::VM::String> h; - }; - - template<> - struct equal_to<OpenAxiom::VM::Package> { - using arg_type = OpenAxiom::VM::Package; - bool operator()(const arg_type& x, const arg_type& y) const { - constexpr equal_to<OpenAxiom::VM::String> eq { }; - return eq(x.name, y.name); - } - }; -} +template<> +struct std::hash<OpenAxiom::VM::Package> { + auto operator()(const OpenAxiom::VM::Package& s) const { + return h(s.name); + } + hash<OpenAxiom::VM::String> h; +}; + +template<> +struct std::equal_to<OpenAxiom::VM::Package> { + using arg_type = OpenAxiom::VM::Package; + bool operator()(const arg_type& x, const arg_type& y) const { + constexpr equal_to<OpenAxiom::VM::String> eq { }; + return eq(x.name, y.name); + } +}; namespace OpenAxiom { namespace Lisp { |