From: Martin Quinson Date: Fri, 30 Mar 2018 22:15:57 +0000 (+0200) Subject: Merge branch 'master' of github.com:simgrid/simgrid X-Git-Tag: v3.20~572 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/95199f4ffa751d3614a07fefe6b3caa6deca1b97?hp=0542dca1b5c334f0482f3dd62a21faa017a884c5 Merge branch 'master' of github.com:simgrid/simgrid --- diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index a274225de1..236d87f962 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -145,10 +145,12 @@ typename std::enable_if([&value,callback](const T& val) { + callback(val); + value = std::move(val); + } + )); } /** Bind a variable to configuration flag @@ -167,11 +169,13 @@ typename std::enable_if([&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