Skip to content

Commit 3f9d548

Browse files
authored
Merge pull request #52 from CosmoStat/binfunction
Binfunction
2 parents cf121ac + 470cf35 commit 3f9d548

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

src/sparse/libmga2d/WPackets.h

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,32 @@
2828
#include "map"
2929
#include "vector"
3030

31+
using namespace std;
32+
3133
struct Pt {int x; int y;};
3234
struct InfoBlock {int IndImage; int Num; Pt BeginCoord; Pt Size;};
35+
/*
3336
struct CmpInfoBlock :
34-
public binary_function <const InfoBlock, const InfoBlock, bool> {
35-
bool operator () (const InfoBlock& Key1, const InfoBlock& Key2) const {
36-
return (Key1.Num < Key2.Num ? true : false);
37-
}
38-
};
37+
public binary_function <const InfoBlock, const InfoBlock, bool> {
38+
bool operator () (const InfoBlock& Key1, const InfoBlock& Key2) const {
39+
return (Key1.Num < Key2.Num ? true : false);
40+
}
41+
};
42+
*/
43+
// binary_function is deprecated, and cannot be compiled anymore with clang-15.0
44+
// In https://reviews.llvm.org/D35455 (line 73), it is proposed to use instead the following lines:
45+
//
46+
struct CmpInfoBlock {
47+
typedef InfoBlock first_argument_type;
48+
typedef InfoBlock second_argument_type;
49+
typedef bool result_Type;
50+
51+
bool operator() (const InfoBlock& Key1, const InfoBlock& Key2) const {
52+
return (Key1.Num < Key2.Num ? true : false);
53+
}
54+
};
55+
56+
3957
struct InfoTrans {InfoBlock Parent; vector<InfoBlock> Child;};
4058
typedef map <InfoBlock,InfoTrans,CmpInfoBlock> MapInfo;
4159
typedef map <int,Ifloat*> MapTransf;

0 commit comments

Comments
 (0)