From: Arnaud Giersch Date: Tue, 17 Apr 2018 21:17:31 +0000 (+0200) Subject: Cosmetics: move declaration. X-Git-Tag: v3.20~402 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2a400850224d856b085f085184ce01dc0cd16473?hp=3707f6d4c79bc1dd20cff273b0c818ef87c39139 Cosmetics: move declaration. --- diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index 6f3283562a..33adc28b94 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -118,33 +118,24 @@ void bindFlag(T& value, std::initializer_list names, const char* de * */ // F is a checker, F : T& -> () -template -typename std::enable_if()(std::declval()) ) ->::value, void>::type -bindFlag(T& value, std::initializer_list names, const char* description, - F callback) +template +typename std::enable_if()(std::declval()))>::value, void>::type +bindFlag(T& value, const char* name, const char* description, F callback) { - bindFlag(value, *names.begin(), description); - alias(names); + declareFlag(name, description, value, std::function([&value, callback](const T& val) { + callback(val); + value = std::move(val); + })); } -template -typename std::enable_if()(std::declval()) ) ->::value, void>::type -bindFlag(T& value, const char* name, const char* description, - F callback) +template +typename std::enable_if()(std::declval()))>::value, void>::type +bindFlag(T& value, std::initializer_list names, const char* description, F callback) { - declareFlag(name, description, value, - std::function([&value,callback](const T& val) { - callback(val); - value = std::move(val); - } - )); + bindFlag(value, *names.begin(), description); + alias(names); } + template typename std::enable_if()(std::declval()))>::value, void>::type bindFlag(T& value, const char* name, const char* description, std::map valid_values, F callback)