From: Arnaud Giersch Date: Sun, 11 Mar 2018 20:58:53 +0000 (+0100) Subject: Fix spurious const_cast. X-Git-Tag: v3.19~87 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/978002647ac64c5880295a6c4ddde0cc50cab465 Fix spurious const_cast. --- diff --git a/src/kernel/resource/Resource.cpp b/src/kernel/resource/Resource.cpp index dc462309db..ff87ae8277 100644 --- a/src/kernel/resource/Resource.cpp +++ b/src/kernel/resource/Resource.cpp @@ -64,7 +64,7 @@ bool Resource::operator==(const Resource& other) const kernel::lmm::Constraint* Resource::constraint() const { - return const_cast(constraint_); + return constraint_; } } // namespace resource diff --git a/src/kernel/resource/Resource.hpp b/src/kernel/resource/Resource.hpp index 4c9e6db3b9..e9b66c582c 100644 --- a/src/kernel/resource/Resource.hpp +++ b/src/kernel/resource/Resource.hpp @@ -73,7 +73,7 @@ public: /* LMM */ kernel::lmm::Constraint* constraint() const; protected: - const kernel::lmm::Constraint* constraint_ = nullptr; + kernel::lmm::Constraint* const constraint_ = nullptr; struct Metric { double peak; /**< The peak of the metric, ie its max value */