Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix spurious const_cast.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Mar 2018 20:58:53 +0000 (21:58 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Mar 2018 21:41:29 +0000 (22:41 +0100)
src/kernel/resource/Resource.cpp
src/kernel/resource/Resource.hpp

index dc46230..ff87ae8 100644 (file)
@@ -64,7 +64,7 @@ bool Resource::operator==(const Resource& other) const
 
 kernel::lmm::Constraint* Resource::constraint() const
 {
-  return const_cast<kernel::lmm::Constraint*>(constraint_);
+  return constraint_;
 }
 
 } // namespace resource
index 4c9e6db..e9b66c5 100644 (file)
@@ -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 */