X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f409d6f711ba652a6fd78e185791cf7870b6765d..4471fa5173daa405358d9656e6172582fae4b3e3:/include/xbt/config.hpp diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index 4430150115..87343a0c19 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2016-2021. 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. */ @@ -132,7 +132,7 @@ void bind_flag(T& value, const char* name, std::initializer_list al */ // F is a checker, F : T& -> () template -typename std::enable_if()(std::declval()))>::value, void>::type +typename std::enable_if_t()(std::declval()))>::value, void> bind_flag(T& value, const char* name, const char* description, F callback) { declare_flag(name, description, value, std::function([&value, callback](const T& val) { @@ -142,7 +142,7 @@ bind_flag(T& value, const char* name, const char* description, F callback) } template -typename std::enable_if()(std::declval()))>::value, void>::type +typename std::enable_if_t()(std::declval()))>::value, void> bind_flag(T& value, const char* name, std::initializer_list aliases, const char* description, F callback) { bind_flag(value, name, description, std::move(callback)); @@ -150,8 +150,8 @@ bind_flag(T& value, const char* name, std::initializer_list aliases } template -typename std::enable_if()(std::declval()))>::value, - void>::type +typename std::enable_if_t()(std::declval()))>::value, + void> bind_flag(std::string& value, const char* name, const char* description, const std::map>& valid_values, F callback) { @@ -159,7 +159,7 @@ bind_flag(std::string& value, const char* name, const char* description, std::function([&value, name, valid_values, callback](const std::string& val) { callback(val); if (valid_values.find(val) != valid_values.end()) { - value = std::move(val); + value = val; return; } std::string mesg = "\n"; @@ -173,8 +173,8 @@ bind_flag(std::string& value, const char* name, const char* description, })); } template -typename std::enable_if()(std::declval()))>::value, - void>::type +typename std::enable_if_t()(std::declval()))>::value, + void> bind_flag(std::string& value, const char* name, std::initializer_list aliases, const char* description, const std::map>& valid_values, F callback) { @@ -191,7 +191,7 @@ bind_flag(std::string& value, const char* name, std::initializer_list bool template -typename std::enable_if()(std::declval()))>::value, void>::type +typename std::enable_if_t()(std::declval()))>::value, void> bind_flag(T& value, const char* name, const char* description, F callback) { declare_flag(name, description, value, std::function([&value, callback](const T& val) { @@ -256,7 +256,7 @@ public: F callback) : value_(value), name_(name) { - simgrid::config::bind_flag(value_, name, desc, std::move(valid_values), std::move(callback)); + simgrid::config::bind_flag(value_, name, desc, valid_values, std::move(callback)); } /* A constructor with everything */