From 44a5cfc3d3b8a6eef64ece3480623b864c0fcc35 Mon Sep 17 00:00:00 2001 From: Diego Ferigo Date: Mon, 7 May 2018 11:04:35 +0200 Subject: [PATCH] ParameterMetadata::operator== should be const --- toolbox/include/base/Parameter.h | 4 ++-- toolbox/src/base/Parameter.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolbox/include/base/Parameter.h b/toolbox/include/base/Parameter.h index a5be2c525..600d66692 100644 --- a/toolbox/include/base/Parameter.h +++ b/toolbox/include/base/Parameter.h @@ -82,8 +82,8 @@ class wbt::ParameterMetadata ParameterMetadata& operator=(const ParameterMetadata& paramMD); ParameterMetadata& operator=(ParameterMetadata&& paramMD); - bool operator==(const ParameterMetadata& rhs); - inline bool operator!=(const ParameterMetadata& rhs) { return !(*this == rhs); } + bool operator==(const ParameterMetadata& rhs) const; + inline bool operator!=(const ParameterMetadata& rhs) const { return !(*this == rhs); } }; /** diff --git a/toolbox/src/base/Parameter.cpp b/toolbox/src/base/Parameter.cpp index c01780ba8..44ef4a5cb 100644 --- a/toolbox/src/base/Parameter.cpp +++ b/toolbox/src/base/Parameter.cpp @@ -53,7 +53,7 @@ ParameterMetadata& ParameterMetadata::operator=(ParameterMetadata&& other) return *this; } -bool ParameterMetadata::operator==(const ParameterMetadata& rhs) +bool ParameterMetadata::operator==(const ParameterMetadata& rhs) const { bool ok = true; ok = ok && (this->index == rhs.index);