Skip to content

Commit

Permalink
Merge pull request #52 from CosmoStat/binfunction
Browse files Browse the repository at this point in the history
Binfunction
  • Loading branch information
jstarck authored Dec 22, 2023
2 parents cf121ac + 470cf35 commit 3f9d548
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/sparse/libmga2d/WPackets.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,32 @@
#include "map"
#include "vector"

using namespace std;

struct Pt {int x; int y;};
struct InfoBlock {int IndImage; int Num; Pt BeginCoord; Pt Size;};
/*
struct CmpInfoBlock :
public binary_function <const InfoBlock, const InfoBlock, bool> {
bool operator () (const InfoBlock& Key1, const InfoBlock& Key2) const {
return (Key1.Num < Key2.Num ? true : false);
}
};
public binary_function <const InfoBlock, const InfoBlock, bool> {
bool operator () (const InfoBlock& Key1, const InfoBlock& Key2) const {
return (Key1.Num < Key2.Num ? true : false);
}
};
*/
// binary_function is deprecated, and cannot be compiled anymore with clang-15.0
// In https://reviews.llvm.org/D35455 (line 73), it is proposed to use instead the following lines:
//
struct CmpInfoBlock {
typedef InfoBlock first_argument_type;
typedef InfoBlock second_argument_type;
typedef bool result_Type;

bool operator() (const InfoBlock& Key1, const InfoBlock& Key2) const {
return (Key1.Num < Key2.Num ? true : false);
}
};


struct InfoTrans {InfoBlock Parent; vector<InfoBlock> Child;};
typedef map <InfoBlock,InfoTrans,CmpInfoBlock> MapInfo;
typedef map <int,Ifloat*> MapTransf;
Expand Down

0 comments on commit 3f9d548

Please sign in to comment.