From: Wolfgang Bangerth Date: Wed, 9 Mar 2016 13:55:07 +0000 (-0600) Subject: Add another note. X-Git-Tag: v8.5.0-rc1~1233^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2326%2Fhead;p=dealii.git Add another note. --- 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 */