From: Wolfgang Bangerth Date: Fri, 19 Jul 2024 22:37:58 +0000 (-0600) Subject: Add a comment to the documentation of Lazy. X-Git-Tag: v9.6.0-rc1~54^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31f486cde07280873853365ab19074ef7d035025;p=dealii.git Add a comment to the documentation of Lazy. --- diff --git a/include/deal.II/base/lazy.h b/include/deal.II/base/lazy.h index b956b92e79..d620179646 100644 --- a/include/deal.II/base/lazy.h +++ b/include/deal.II/base/lazy.h @@ -96,7 +96,7 @@ DEAL_II_NAMESPACE_OPEN * }); * } * - * const FullMatrix & get_prolongation_matrix() const + * FullMatrix get_prolongation_matrix() const * { * return prolongation_matrix.get(); * } @@ -118,7 +118,11 @@ DEAL_II_NAMESPACE_OPEN * whereas in the scheme with `std::async`, one has to be careful not to * capture information in the lambda function that could be changed by later * calls to member functions but before the lambda function is finally - * evaluated in the getter function. + * evaluated in the getter function. (There is another difference: + * `std::future::get()` can only be called once, as the function returns + * the computed object by value and may move the object out of its internal + * storage. As a consequence, the call to `FE::get_prolongation_matrix()` + * is only valid the first time around. Lazy does not have this restriction.) * * @dealiiConceptRequires{std::is_move_constructible_v && std::is_move_assignable_v}