1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
commit 2f4f47ea07a3a13ae7793d8ab9c21c97bc77567a
Author: Jan Kohnert <jan@jan-kohnert.de>
Date: Thu May 26 12:32:01 2022 +0200
Replaced deprecated std::unary_function and std::binary_function by C++11 std::function
diff --git a/src/antlr/CharScanner.hpp b/src/antlr/CharScanner.hpp
index c123cb17..c5e0604d 100644
--- a/src/antlr/CharScanner.hpp
+++ b/src/antlr/CharScanner.hpp
@@ -31,6 +31,9 @@
# include <stdio.h>
#endif
+// std::function needs this one
+#include <functional>
+
#include <antlr/TokenStream.hpp>
#include <antlr/RecognitionException.hpp>
#include <antlr/SemanticException.hpp>
@@ -71,7 +74,7 @@ ANTLR_C_USING(strcasecmp)
/** Functor for the literals map
*/
-class ANTLR_API CharScannerLiteralsLess : public ANTLR_USE_NAMESPACE(std)binary_function<ANTLR_USE_NAMESPACE(std)string,ANTLR_USE_NAMESPACE(std)string,bool> {
+class ANTLR_API CharScannerLiteralsLess : public ANTLR_USE_NAMESPACE(std)function<bool(ANTLR_USE_NAMESPACE(std)string,ANTLR_USE_NAMESPACE(std)string)> {
private:
const CharScanner* scanner;
public:
diff --git a/src/dcommon.hpp b/src/dcommon.hpp
index 35dc3c8c..d7965974 100644
--- a/src/dcommon.hpp
+++ b/src/dcommon.hpp
@@ -65,7 +65,7 @@ public:
DCommon* getCommon(void) { return this; };
};
-class DCommon_eq: public std::unary_function<DCommon,bool>
+class DCommon_eq: public std::function<bool(DCommon)>
{
std::string name;
public:
@@ -102,7 +102,7 @@ public:
typedef std::vector<DCommonBase*> CommonBaseListT;
typedef std::vector<DCommon*> CommonListT;
-class DCommon_contains_var: public std::unary_function<DCommonBase,bool>
+class DCommon_contains_var: public std::function<bool(DCommonBase*)>
{
std::string name;
public:
diff --git a/src/dcompiler.hpp b/src/dcompiler.hpp
index 805e7fb6..1947bfb0 100644
--- a/src/dcompiler.hpp
+++ b/src/dcompiler.hpp
@@ -94,7 +94,7 @@ public:
EnvBaseT* GetEnv() const { return env;}
void SetEnv( EnvBaseT* e) { env = e;}
// for sorting lists by name
- struct CompLibFunName: public std::binary_function< DLibFun*, DLibFun*, bool>
+ struct CompLibFunName: public std::function<bool(DLibFun*, DLibFun*)>
{
bool operator() ( DLibFun* f1, DLibFun* f2) const
{ return f1->ObjectName() < f2->ObjectName();}
diff --git a/src/dpro.hpp b/src/dpro.hpp
index 5df241a3..e234b16e 100644
--- a/src/dpro.hpp
+++ b/src/dpro.hpp
@@ -36,7 +36,7 @@
extern bool posixpaths;
}
#endif
-template<typename T> class Is_eq: public std::unary_function<T,bool>
+template<typename T> class Is_eq: public std::function<bool(T)>
{
std::string name;
public:
@@ -208,7 +208,7 @@ public:
// for sorting lists by name. Not used (lists too short to make a time gain. Long lists would, if existing,
// benefit from sorting by hash number in a std::map instead of a std::list.
- struct CompLibFunName: public std::binary_function< DLib*, DLib*, bool>
+ struct CompLibFunName: public std::function<bool(DLib*, DLib*)>
{
bool operator() ( DLib* f1, DLib* f2) const
{ return f1->ObjectName() < f2->ObjectName();}
diff --git a/src/dstructdesc.hpp b/src/dstructdesc.hpp
index b09a371c..659cab15 100644
--- a/src/dstructdesc.hpp
+++ b/src/dstructdesc.hpp
@@ -362,7 +362,7 @@ public:
};
-class DStruct_eq: public std::unary_function<DStructDesc,bool>
+class DStruct_eq: public std::function<bool(DStructDesc)>
{
std::string name;
diff --git a/src/dvar.hpp b/src/dvar.hpp
index e34ce70e..37b33cc5 100644
--- a/src/dvar.hpp
+++ b/src/dvar.hpp
@@ -57,7 +57,7 @@ public:
typedef std::vector<DVar*> VarListT;
-class DVar_eq: public std::unary_function<DVar,bool>
+class DVar_eq: public std::function<bool(DVar)>
{
std::string name;
BaseGDL* pp;
diff --git a/src/gdlhelp.cpp b/src/gdlhelp.cpp
index 2216bbb2..837dbd3b 100644
--- a/src/gdlhelp.cpp
+++ b/src/gdlhelp.cpp
@@ -126,7 +126,7 @@ extern "C" {
// for sorting compiled pro/fun lists by name
-struct CompFunName: public std::binary_function< DFun*, DFun*, bool>
+struct CompFunName: public std::function<bool(DFun*, DFun*)>
{
bool operator() ( DFun* f1, DFun* f2) const
{
@@ -134,7 +134,7 @@ struct CompFunName: public std::binary_function< DFun*, DFun*, bool>
}
};
-struct CompProName: public std::binary_function< DPro*, DPro*, bool>
+struct CompProName: public std::function<bool(DPro*, DPro*)>
{
bool operator() ( DPro* f1, DPro* f2) const
{
diff --git a/src/str.hpp b/src/str.hpp
index e88dff88..2459157d 100644
--- a/src/str.hpp
+++ b/src/str.hpp
@@ -88,7 +88,7 @@ void StrLowCaseInplace(std::string&);
std::string StrCompress(const std::string&,bool removeAll);
void StrPut(std::string& s1, const std::string& s2, DLong pos);
-class String_abbref_eq: public std::unary_function< std::string, bool>
+class String_abbref_eq: public std::function<bool(std::string)>
{
std::string s;
public:
@@ -100,7 +100,7 @@ public:
}
};
-class String_eq: public std::unary_function< std::string, bool>
+class String_eq: public std::function<bool(std::string)>
{
std::string s;
public:
|