]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let GrowingVectorMemory work with std::vector. 5628/head
authorDavid Wells <wellsd2@rpi.edu>
Fri, 15 Dec 2017 15:53:07 +0000 (10:53 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Fri, 15 Dec 2017 15:53:07 +0000 (10:53 -0500)
The VectorType class in

std::pair<bool, std::unique_ptr<VectorType>>

may not have a memory_consumption() member function (e.g.,
std::vector). Get around this by just using the free function instead.

include/deal.II/lac/vector_memory.templates.h

index 4bd60279c3e2a118cc7efeabd3946e5d15d500f7..41dac85989dd4b41d8a2812d099e6f28765f7cff 100644 (file)
 #define dealii_vector_memory_templates_h
 
 
-#include <deal.II/lac/vector_memory.h>
 #include <deal.II/base/std_cxx14/memory.h>
+#include <deal.II/base/memory_consumption.h>
+
+#include <deal.II/lac/vector_memory.h>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -181,7 +183,7 @@ GrowingVectorMemory<VectorType>::memory_consumption () const
   end = pool.data->end();
   for (typename std::vector<entry_type>::const_iterator
        i = pool.data->begin(); i != end ; ++i)
-    result += sizeof (*i) + i->second->memory_consumption();
+    result += sizeof (*i) + MemoryConsumption::memory_consumption(i->second);
 
   return result;
 }

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.