From fbcb7681b91497b34e530d74fd36467bc70c57c8 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 9 Mar 2016 07:55:07 -0600 Subject: [PATCH] Add another note. --- include/deal.II/base/thread_management.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index 588732b080..5821c7f3ad 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -3142,7 +3142,15 @@ namespace Threads * In particular, they will likely capture variables * from the surrounding context and use them within the lambda. * See https://en.wikipedia.org/wiki/Anonymous_function#C.2B.2B_.28since_C.2B.2B11.29 - * for more on this. + * for more on how lambda functions work. + * + * @note If you pass a lambda function as an argument to the + * current function that captures a variable by reference, + * or if you use a std::bind that binds a function argument to + * a reference variable using std::ref() or std::cref(), then + * obviously you can only do this if the variables you reference + * or capture have a lifetime that extends at least until the time + * where the task finishes. * * @ingroup CPP11 */ -- 2.39.5