Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / simgrid / module.cpp
index dbfdf01..5724971 100644 (file)
@@ -6,8 +6,8 @@
 #include <xbt/asserts.h>
 #include <xbt/log.h>
 
-#include "simgrid/sg_config.hpp"
 #include "src/simgrid/module.hpp"
+#include "src/simgrid/sg_config.hpp"
 
 #include <sstream>
 
@@ -42,14 +42,14 @@ void ModuleGroup::create_flag(const std::string& opt_name, const std::string& de
           by_name(value); // Simply ensure that this value exists, it will be picked up later
       });
 }
-void ModuleGroup::init_from_flag_value()
+void ModuleGroup::init_from_flag_value() const
 {
   by_name(simgrid::config::get_value<std::string>(opt_name_)).init();
 }
 
 ModuleGroup& ModuleGroup::add(const char* id, const char* desc, std::function<void()> init)
 {
-  table_.emplace_back(Module(id, desc, init));
+  table_.emplace_back(id, desc, std::move(init));
   return *this;
 }