]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adapt @asartori's patch to fix the correct problem.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Aug 2017 14:01:17 +0000 (08:01 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Aug 2017 14:25:04 +0000 (08:25 -0600)
include/deal.II/base/function_parser.h

index 5170af931aff6e408ddd6dd138ab1a94cf7d2a2b..6a4accae915e6bb1e3ff1c7119151b7c6445d8e4 100644 (file)
@@ -328,11 +328,17 @@ private:
 
   /**
    * The muParser objects for each thread (and one for each component). We are
-   * storing shared_ptr so that we don't need to include the definition of
+   * storing a unique_ptr so that we don't need to include the definition of
    * mu::Parser in this header.
    */
-  // std::unique_ptr does not compile with gcc-5.4
+#if TBB_VERSION_MAJOR >= 4
+  mutable Threads::ThreadLocalStorage<std::vector<std::unique_ptr<mu::Parser> > > fp;
+#else
+  // older TBBs have a bug in which they want to return thread-local
+  // objects by value. this doesn't work for std::unique_ptr, so use a
+  // std::shared_ptr
   mutable Threads::ThreadLocalStorage<std::vector<std::shared_ptr<mu::Parser> > > fp;
+#endif
 
   /**
    * An array to keep track of all the constants, required to initialize fp in

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.