Skip to content

Commit

Permalink
Make fecom's base_hit comparator call const
Browse files Browse the repository at this point in the history
AppleClang 9.1 now fails to compile fecom base_hit with a
promoted-to-error warning about base_hit::compare's call
operator not being const.

Make operator explicitly const as it is!
  • Loading branch information
drbenmorgan committed Apr 11, 2018
1 parent 7938802 commit a2ee404
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion companions/fecom/src/libs/libfecom/fecom/base_hit.cpp
Expand Up @@ -64,7 +64,7 @@ void base_hit::tree_dump(std::ostream& out_, const std::string& title_, const st
return;
}

bool base_hit::compare::operator()(const base_hit& a, const base_hit& b) {
bool base_hit::compare::operator()(const base_hit& a, const base_hit& b) const {
if (a.hit_id < b.hit_id) {
return true;
} else if ((a.hit_id == b.hit_id)) {
Expand Down
2 changes: 1 addition & 1 deletion companions/fecom/src/libs/libfecom/fecom/base_hit.hpp
Expand Up @@ -27,7 +27,7 @@ struct base_hit : public datatools::i_serializable {

/// Compare two base hits by hit id
struct compare {
bool operator()(const base_hit& a, const base_hit& b);
bool operator()(const base_hit& a, const base_hit& b) const;
};

/// Compare two base hits by timestamp
Expand Down

0 comments on commit a2ee404

Please sign in to comment.