]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around an issue in a copy constructor we needed for C++11 compatibility and...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 1 Oct 2013 00:24:55 +0000 (00:24 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 1 Oct 2013 00:24:55 +0000 (00:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@31054 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/work_stream.h

index 99e3b7d4c2b4d4b0635ed9c65dc41f13c760d84c..5c7b05d500e18f1cff2ead1ad0cdea93e1f6c0f1 100644 (file)
@@ -189,12 +189,16 @@ namespace WorkStream
 
 //TODO:        when we push back an object to the list of scratch objects, in
 //     Worker::operator(), we first create an object and then copy
-//     it to the end of this list. We should avoid the copy operations
-//     since it is expensive
+//     it to the end of this list. this involves having two objects
+//      of the current type having pointers to it, each with their own
+//      currently_in_use flag. there is probably little harm in this because
+//      the original one goes out of scope right away again, but it's
+//      certainly awkward. one way to avoid this would be to use unique_ptr
+//      but we'd need to figure out a way to use it in non-C++11 mode
           ScratchDataObject (const ScratchDataObject &o)
             :
-           scratch_data (new ScratchData(*o.scratch_data)),
-            currently_in_use (false)
+           scratch_data (o.scratch_data),
+            currently_in_use (o.currently_in_use)
           {}
         };
 

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.