From bf6e09ad4a0ea12c2a007bb19670bbb0710a7c6c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 19 Apr 2019 13:20:29 +0200 Subject: [PATCH] Fix build errors with gcc 5.4.0. --- src/instr/instr_paje_types.cpp | 2 +- src/xbt/config.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 335cb12b5a..149d426186 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -22,7 +22,7 @@ Type::Type(const std::string& name, const std::string& alias, const std::string& THROWF(tracing_error, 0, "can't create a new type with no name or alias"); if (father != nullptr){ - father->children_.emplace(alias, this); + father->children_.emplace(alias, std::unique_ptr(this)); XBT_DEBUG("new type %s, child of %s", get_cname(), father->get_cname()); } if (trace_format == simgrid::instr::TraceFormat::Paje) { diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 90c3c63ea3..b4d7e54236 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.emplace(name, std::unique_ptr(variable)); variable->update(); return variable; } -- 2.20.1