X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2738598c9f876339ee6f8b3fc217984b7b837539..84637d5a56f373e75eb6619d1afb54b7da3f5e36:/src/xbt/config.cpp diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 90c3c63ea3..0ac0581661 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -253,9 +253,9 @@ template const char* TypedConfigurationElement::get_type_name() // class Config { private: // name -> ConfigElement: - std::map> options; + std::map> options; // alias -> ConfigElement from options: - std::map aliases; + std::map aliases; bool warn_for_aliases = true; public: @@ -268,15 +268,14 @@ public: ConfigurationElement& operator[](const std::string& name); void alias(const std::string& realname, const std::string& aliasname); - template - simgrid::config::TypedConfigurationElement* register_option(const std::string& name, A&&... a) + template TypedConfigurationElement* register_option(const std::string& name, A&&... a) { xbt_assert(options.find(name) == options.end(), "Refusing to register the config element '%s' twice.", name.c_str()); TypedConfigurationElement* variable = new TypedConfigurationElement(name, std::forward(a)...); XBT_DEBUG("Register cfg elm %s (%s) of type %s @%p in set %p)", name.c_str(), variable->get_description().c_str(), variable->get_type_name(), variable, this); - options.emplace(name, variable); + options[name].reset(variable); variable->update(); return variable; }