summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2023-12-12 08:03:26 +0100
committerJohn Wiegley <johnw@newartisans.com>2023-12-12 19:56:21 +0100
commitc9034485cbac45dfb0923ba29c11e617d7ac5151 (patch)
treebf92f61f440af67324fd1b25d4694536045c83d5 /src
parentb9740e127196b2e23cd249ca671c7af08ab81321 (diff)
downloadfork-ledger-c9034485cbac45dfb0923ba29c11e617d7ac5151.tar.gz
fork-ledger-c9034485cbac45dfb0923ba29c11e617d7ac5151.tar.bz2
fork-ledger-c9034485cbac45dfb0923ba29c11e617d7ac5151.zip
Fix compiler warning about std::binary_function
being deprecated as of C++11
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/history.cc6
-rw-r--r--src/item.cc2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4e0e23de..0d6bc085 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -183,7 +183,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (BUILD_LIBRARY)
list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
endif()
- list(APPEND _args "-std=c++11 ")
+ list(APPEND _args "-std=c++11")
if (CYGWIN)
list(APPEND _args "-U__STRICT_ANSI__")
endif()
diff --git a/src/history.cc b/src/history.cc
index dbcdc823..d5eb727c 100644
--- a/src/history.cc
+++ b/src/history.cc
@@ -39,7 +39,11 @@
#include "history.h"
template <typename T>
-struct f_max : public std::binary_function<T, T, bool> {
+struct f_max
+#if __cplusplus < 201103L
+: public std::binary_function<T, T, bool>
+#endif
+{
T operator()(const T& x, const T& y) const {
return std::max(x, y);
}
diff --git a/src/item.cc b/src/item.cc
index 30727c1b..df0ce920 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -105,7 +105,9 @@ optional<value_t> item_t::get_tag(const mask_t& tag_mask,
namespace {
struct CaseInsensitiveKeyCompare
+#if __cplusplus < 201103L
: public std::binary_function<string, string, bool>
+#endif
{
bool operator()(const string& s1, const string& s2) const {
return boost::algorithm::ilexicographical_compare(s1, s2);