From 31f486cde07280873853365ab19074ef7d035025 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 19 Jul 2024 16:37:58 -0600 Subject: [PATCH] Add a comment to the documentation of Lazy. --- include/deal.II/base/lazy.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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} -- 2.39.5