diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-26 13:43:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-26 13:43:51 +0200 |
commit | f46f33a29f55ed70ec4e5f45bafeca8e1b51dc76 (patch) | |
tree | 951cf37e9fe46a9340e9421f675613d5ed64bf59 | |
parent | 628cc222d71e9f12049b85807d51f3c766db5be0 (diff) |
Add compare_reference_target
-rw-r--r-- | libbutl/utility.mxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libbutl/utility.mxx b/libbutl/utility.mxx index 988ca22..4c83827 100644 --- a/libbutl/utility.mxx +++ b/libbutl/utility.mxx @@ -162,7 +162,10 @@ LIBBUTL_MODEXPORT namespace butl struct compare_pointer_target { template <typename P> - bool operator() (const P& x, const P& y) const {return *x < *y;} + bool operator() (const P& x, const P& y) const + { + return *x < *y; + } }; //struct hash_pointer_target @@ -171,6 +174,17 @@ LIBBUTL_MODEXPORT namespace butl // std::size_t operator() (const P& x) const {return std::hash (*x);} //}; + // Compare two std::reference_wrapper's. + // + struct compare_reference_target + { + template <typename R> + bool operator() (const R& x, const R& y) const + { + return x.get () < y.get (); + } + }; + // Combine one or more hash values. // inline std::size_t |