perseus: fix build with gcc15 (#518891)

This commit is contained in:
Peder Bergebakken Sundt
2026-05-13 18:26:56 +00:00
committed by GitHub
2 changed files with 62 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
diff --git a/Cells/Point.h b/Cells/Point.h
index b03113c..472372e 100644
--- a/Cells/Point.h
+++ b/Cells/Point.h
@@ -91,7 +91,7 @@ public:
template <typename PS>
struct ptcomp
{
- bool operator ()(Point<PS>* p, Point<PS>* q)
+ bool operator ()(Point<PS>* p, Point<PS>* q) const
{
if (p == q) return false;
if (p == NULL && q != NULL) return true;
@@ -106,7 +106,7 @@ struct ptcomp
template <typename PS>
struct ptcomplex
{
- bool operator ()(Point<PS>* p, Point<PS>* q)
+ bool operator ()(Point<PS>* p, Point<PS>* q) const
{
if (p == q) return false;
if (p == NULL && q != NULL) return true;
diff --git a/Complexes/CToplex.h b/Complexes/CToplex.h
index bdd026f..732701e 100644
--- a/Complexes/CToplex.h
+++ b/Complexes/CToplex.h
@@ -24,7 +24,7 @@
// vector lexico comparison for map-making
struct addcomp
{
- bool operator () (vector<num>* v1, vector<num>* v2)
+ bool operator () (vector<num>* v1, vector<num>* v2) const
{
//cout<<" here "; cin.get();
if (v1 == v2) return false;
diff --git a/Global/Combinatorics.h b/Global/Combinatorics.h
index d751a04..d8cf6b2 100644
--- a/Global/Combinatorics.h
+++ b/Global/Combinatorics.h
@@ -18,7 +18,7 @@
// order nums increasingly
struct incnum
{
- bool operator() (num n1, num n2)
+ bool operator() (num n1, num n2) const
{
return (n1 < n2);
}
@@ -28,7 +28,7 @@ struct incnum
// order nums decreasingly
struct decnum
{
- bool operator() (num n1, num n2)
+ bool operator() (num n1, num n2) const
{
return (n1 > n2);
}
+5
View File
@@ -18,6 +18,11 @@ stdenv.mkDerivation {
};
sourceRoot = ".";
patches = [
./fix-gcc15.patch
];
env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ];
buildPhase = ''
g++ Pers.cpp -O3 -fpermissive -o perseus