]> git.tdb.fi Git - libs/core.git/commitdiff
Add a flipped operator() to MemberCompare so upper_bound_member can work
authorMikko Rasa <tdb@tdb.fi>
Tue, 23 Nov 2021 08:57:06 +0000 (10:57 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 23 Nov 2021 08:57:06 +0000 (10:57 +0200)
source/core/algorithm.h

index 268bf7b89f9ca54ac56ae6ff7d51e4f2fbfb64cc..51c2369d623b58790f4ca556018d0162cb96a185 100644 (file)
@@ -132,6 +132,7 @@ struct MemberCompare
        MemberCompare(T C::*p): mem_ptr(p) { }
 
        bool operator()(const C &obj, const T &v) { return obj.*mem_ptr<v; }
+       bool operator()(const T &v, const C &obj) { return v<obj.*mem_ptr; }
        bool operator()(const C &obj1, const C &obj2) { return obj1.*mem_ptr<obj2.*mem_ptr; }
 };