diff --git a/src/BookmarkMgr.cpp b/src/BookmarkMgr.cpp index a9db129a..8d94126d 100644 --- a/src/BookmarkMgr.cpp +++ b/src/BookmarkMgr.cpp @@ -389,7 +389,7 @@ BookmarkList BookmarkMgr::getBookmarks(std::string group) { } if (!bmDataSorted[group]) { - std::sort(bmData[group].begin(), bmData[group].end(), BookmarkEntryCompare()); + std::sort(bmData[group].begin(), bmData[group].end(), [](const BookmarkEntryPtr a, const BookmarkEntryPtr b) -> bool { return a->frequency < b->frequency;}); bmDataSorted[group] = true; } @@ -538,7 +538,7 @@ BookmarkRangeList BookmarkMgr::getRanges() { std::lock_guard < std::recursive_mutex > lock(busy_lock); if (!rangesSorted) { - std::sort(ranges.begin(), ranges.end(), BookmarkRangeEntryCompare()); + std::sort(ranges.begin(), ranges.end(), [](const BookmarkRangeEntryPtr a, const BookmarkRangeEntryPtr b) -> bool { return a->freq < b->freq;}); rangesSorted = true; } diff --git a/src/BookmarkMgr.h b/src/BookmarkMgr.h index 4a96777f..d64dba84 100644 --- a/src/BookmarkMgr.h +++ b/src/BookmarkMgr.h @@ -48,23 +48,6 @@ class BookmarkRangeEntry { typedef std::shared_ptr BookmarkEntryPtr; typedef std::shared_ptr BookmarkRangeEntryPtr; -struct BookmarkEntryCompare : public std::binary_function -{ - bool operator()(const BookmarkEntryPtr a, BookmarkEntryPtr b) const - { - return a->frequency < b->frequency; - } -}; - - -struct BookmarkRangeEntryCompare : public std::binary_function -{ - bool operator()(const BookmarkRangeEntryPtr a, BookmarkRangeEntryPtr b) const - { - return a->freq < b->freq; - } -}; - typedef std::vector BookmarkList; typedef std::vector BookmarkRangeList; typedef std::map BookmarkMap; diff --git a/src/IOThread.h b/src/IOThread.h index fc5a570c..39b00a33 100644 --- a/src/IOThread.h +++ b/src/IOThread.h @@ -17,7 +17,7 @@ #include "Timer.h" #include "SpinMutex.h" -struct map_string_less : public std::binary_function +struct map_string_less { bool operator()(const std::string& a,const std::string& b) const { diff --git a/src/util/DataTree.h b/src/util/DataTree.h index c27e7a9a..b99195e4 100755 --- a/src/util/DataTree.h +++ b/src/util/DataTree.h @@ -37,7 +37,7 @@ using namespace std; /* map comparison function */ -struct string_less : public std::binary_function +struct string_less { bool operator()(const std::string& a,const std::string& b) const { @@ -45,14 +45,6 @@ struct string_less : public std::binary_function } }; -/* int comparison function */ -struct int_less : public std::binary_function -{ - bool operator()(int a,int b) const - { - return a < b; - } -}; /* Data Exceptions */