X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9e3b2f1d55a07271c05db2ed5b3fec27561097f9..4b0fa756ae6e58a74c374a519389ecb9e8b6a4d9:/include/xbt/config.hpp diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index fed58c9410..28a83ecfa6 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2016-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -65,7 +65,7 @@ extern template XBT_PUBLIC void set_value(const char* name, bool value); extern template XBT_PUBLIC void set_value(const char* name, std::string value); XBT_PUBLIC void set_as_string(const char* name, const std::string& value); -XBT_PUBLIC void set_parse(std::string options); +XBT_PUBLIC void set_parse(const std::string& options); // Get config @@ -86,16 +86,16 @@ extern template XBT_PUBLIC std::string const& get_value(const std:: * @param callback called with the option value */ template -XBT_PUBLIC void declare_flag(const std::string& name, std::string description, T value, +XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, T value, std::function callback = std::function()); -extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, int value, +extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, int value, std::function callback); -extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, double value, +extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, double value, std::function callback); -extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, bool value, +extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, bool value, std::function callback); -extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, std::string value, +extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, std::string value, std::function callback); // ***** alias ***** @@ -162,7 +162,7 @@ bind_flag(T& value, const char* name, const char* description, std::map Flag& operator=(U const& that) { value_ = that; return *this; } template - Flag& operator=(U && that) { value_ = that; return *this; } + Flag& operator=(U&& that) { value_ = std::forward(that); return *this; } template bool operator==(U const& that) const { return value_ == that; } template @@ -305,9 +304,7 @@ public: XBT_PUBLIC void finalize(); XBT_PUBLIC void show_aliases(); XBT_PUBLIC void help(); -} -} -XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value") XBT_PUBLIC std::string - xbt_cfg_get_string(const char* name); +} // namespace config +} // namespace simgrid #endif