]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add another note. 2326/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 9 Mar 2016 13:55:07 +0000 (07:55 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 9 Mar 2016 13:55:07 +0000 (07:55 -0600)
include/deal.II/base/thread_management.h

index 588732b0805619fe36dd96752a4938b7533f641f..5821c7f3adbb30e7e6c7a6092d05d255864c2f97 100644 (file)
@@ -3142,7 +3142,15 @@ namespace Threads
    *   In particular, they will likely <i>capture</i> 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 <i>by reference</i>,
+   *   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
    */

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.