Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[XBT] Config::get_name -> Make 'this' const
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 18 Jul 2018 10:51:03 +0000 (12:51 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 18 Jul 2018 14:42:11 +0000 (16:42 +0200)
This is not the return value that is const'ed,
but just shows that this method does not change the object.

include/xbt/config.hpp

index 8df3f1e..270ee12 100644 (file)
@@ -278,7 +278,7 @@ public:
   T& get() { return value_; }
   T const& get() const { return value_; }
 
   T& get() { return value_; }
   T const& get() const { return value_; }
 
-  std::string get_name() { return name_; }
+  std::string get_name() const { return name_; }
   // Implicit conversion to the underlying type:
   operator T&() { return value_; }
   operator T const&() const{ return value_; }
   // Implicit conversion to the underlying type:
   operator T&() { return value_; }
   operator T const&() const{ return value_; }