Ah I see what's going on. C++ surprises me as well. I'll fix this after the PR is in --- this patch should do it:
```diff
diff --git a/src/integer.h b/src/integer.h
index b06620b..8c21271 100644
--- a/src/integer.h
+++ b/src/integer.h
@@ -22,7 +22,7 @@ public:
 
     // Convert to "int", raise an exception if it does not fit
     signed long int as_int();
-    inline mpz_class as_mpz() { return this->i; }
+    inline mpz_class as_mpz() const { return this->i; }
     inline virtual bool is_zero() const { return this->i == 0; }
     inline virtual bool is_one() const { return this->i == 1; }
     inline virtual bool is_positive() const { return this->i > 0; }
```