[Rivet] [Rivet 2.6.0] Static assertion failed: comparison object must be invocable as const

Ivan Razumov ivan.razumov at cern.ch
Tue Jul 10 10:21:09 BST 2018


Dear Rivet developers,

when building code that uses Rivet with gcc8 (but not when building 
Rivet itself),
the compiler emits the following error: "Static assertion failed: 
comparison object must be invocable as const".

This error can be fixed with the following patch:

--- include/Rivet/AnalysisHandler.hh.orig       2018-07-10 
10:39:21.719532209 +0200
+++ include/Rivet/AnalysisHandler.hh    2018-07-10 10:39:29.225608530 +0200
@@ -17,7 +17,7 @@

    // Needed to make smart pointers compare equivalent in the STL set
    struct CmpAnaHandle {
-    bool operator() (const AnaHandle& a, const AnaHandle& b) {
+    bool operator() (const AnaHandle& a, const AnaHandle& b) const {
        return a.get() < b.get();
      }
    };

Thanks,
Ivan for the GENSER team

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20180710/bd618cb2/attachment.html>


More information about the Rivet mailing list