X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/36b1fa831a191c389b1c907bfa35655b4283f06d..5ce1cdec3a6f447bb36c3080e7ab38a5be033351:/include/xbt/config.hpp diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index f773739c86..1f46590a3f 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -196,13 +196,11 @@ typename std::enable_if([&value, callback](const T& val) { - if (not callback(val)) - throw std::range_error("invalid value."); - value = std::move(val); - }) - ); + declareFlag(name, description, value, std::function([&value, callback](const T& val) { + if (not callback(val)) + throw std::range_error("invalid value."); + value = std::move(val); + })); } /** A variable bound to a CLI option