X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Falgorithm.h;h=d295d00ab844c02e943f8795904ee8f35367dfd4;hb=95a005d09584925e1d865caea57b9352c0770b00;hp=268bf7b89f9ca54ac56ae6ff7d51e4f2fbfb64cc;hpb=31ab69904294bcbc0f38e4d401fcca620f7c6f61;p=libs%2Fcore.git diff --git a/source/core/algorithm.h b/source/core/algorithm.h index 268bf7b..d295d00 100644 --- a/source/core/algorithm.h +++ b/source/core/algorithm.h @@ -2,6 +2,7 @@ #define MSP_CORE_ALGORITHM_H_ #include +#include namespace Msp { @@ -124,15 +125,17 @@ inline typename Container::const_iterator find_member(const Container &cont, con return find_if(cont, MemberMatch(value, mp)); } -template +template> struct MemberCompare { T C::*mem_ptr; + P pred; MemberCompare(T C::*p): mem_ptr(p) { } - bool operator()(const C &obj, const T &v) { return obj.*mem_ptr