aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-26 13:43:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-26 13:43:51 +0200
commitf46f33a29f55ed70ec4e5f45bafeca8e1b51dc76 (patch)
tree951cf37e9fe46a9340e9421f675613d5ed64bf59
parent628cc222d71e9f12049b85807d51f3c766db5be0 (diff)
Add compare_reference_target
-rw-r--r--libbutl/utility.mxx16
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