From f46f33a29f55ed70ec4e5f45bafeca8e1b51dc76 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 26 Feb 2018 13:43:51 +0200 Subject: Add compare_reference_target --- libbutl/utility.mxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libbutl/utility.mxx') 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 - 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 + bool operator() (const R& x, const R& y) const + { + return x.get () < y.get (); + } + }; + // Combine one or more hash values. // inline std::size_t -- cgit v1.1