Skip to content

Commit

Permalink
Merge pull request #18 from AntelopeIO/c++20operatorwarn
Browse files Browse the repository at this point in the history
add const to operator== & operator!= to avoid c++20 warning
  • Loading branch information
spoonincode authored Aug 17, 2023
2 parents f45305a + 47368da commit b35c027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/chainbase/environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ struct environment {
uint8_t reserved[512] = {};
char compiler[256] = {};

bool operator==(const environment& other) {
bool operator==(const environment& other) const {
return !memcmp(this, &other, sizeof(environment));
}
bool operator!=(const environment& other) {
bool operator!=(const environment& other) const {
return !(*this == other);
}
} __attribute__ ((packed));
Expand Down

0 comments on commit b35c027

Please sign in to comment.