From: Gabriel Corona Date: Fri, 3 Jun 2016 14:51:06 +0000 (+0200) Subject: [xbt] Update comment on xbt::fulfillPromise X-Git-Tag: v3_14~1056^2^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/526b5d0b638034b673d48dea189ff5d047a54891?ds=sidebyside [xbt] Update comment on xbt::fulfillPromise --- diff --git a/include/xbt/future.hpp b/include/xbt/future.hpp index 316f68f675..81c88453e6 100644 --- a/include/xbt/future.hpp +++ b/include/xbt/future.hpp @@ -171,7 +171,14 @@ public: } }; -/** Fulfill a promise by executing a given code */ +/** Execute some code and set a promise or result accordingly + * + * We might need this when working with generic code because + * the trivial implementation does not work with void (before C++1z). + * + * @param code What we want to do + * @param promise Where to want to store the result + */ template auto fulfillPromise(R& promise, F&& code) -> decltype(promise.set_value(code())) @@ -184,11 +191,6 @@ auto fulfillPromise(R& promise, F&& code) } } -/** Fulfill a promise by executing a given code - * - * This is a special version for `std::promise` because the default - * version does not compile in this case. - */ template auto fulfillPromise(P& promise, F&& code) -> decltype(promise.set_value())