X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e55e975804ae9c6ec82a5fbac2c7ea2497757a28..680abdb047c1a66d3ccc14cad518117773c3cc8c:/include/xbt/future.hpp diff --git a/include/xbt/future.hpp b/include/xbt/future.hpp index aa559db2a7..a374bec117 100644 --- a/include/xbt/future.hpp +++ b/include/xbt/future.hpp @@ -9,20 +9,21 @@ #include -#include #include +#include #include - #include - - +#include namespace simgrid { namespace xbt { -/** A value or an exception +/** A value or an exception (or nothing) + * + * This is similar to `optional>`` but it with a Future/Promise + * like API. * - * The API is similar to the one of future and promise. + * Also the name is not so great. **/ template class Result { @@ -117,7 +118,7 @@ public: /** Extract the value from the future * - * After this the value is invalid. + * After this, the value is invalid. **/ T get() { @@ -184,7 +185,7 @@ public: * promise.set_value(code()); * * - * but it takes care of exceptions and works with void. + * but it takes care of exceptions and works with `void`. * * We might need this when working with generic code because * the trivial implementation does not work with `void` (before C++1z). @@ -217,7 +218,7 @@ auto fulfillPromise(P& promise, F&& code) } } -/** Set a promise/result from a future/resul +/** Set a promise/result from a future/result * * Roughly this does: *