]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix MGLevelObject variadic template constructor with default arguments 11277/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 30 Nov 2020 14:24:39 +0000 (09:24 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 30 Nov 2020 14:25:45 +0000 (09:25 -0500)
include/deal.II/base/mg_level_object.h

index 2b57ea888a1165936225c5c929cf6ebad17948fb..f8788fe120a1434d577aa975c4e108a9a4ebefc2 100644 (file)
@@ -71,10 +71,17 @@ public:
    * @pre minlevel <= maxlevel
    */
   template <class... Args>
-  MGLevelObject(const unsigned int minlevel = 0,
-                const unsigned int maxlevel = 0,
+  MGLevelObject(const unsigned int minlevel,
+                const unsigned int maxlevel,
                 Args &&... args);
 
+  /**
+   * Constructor. Same as above but without arguments to be forwarded to the
+   * constructor of the underlying object.
+   */
+  MGLevelObject(const unsigned int minlevel = 0,
+                const unsigned int maxlevel = 0);
+
   /**
    * Access object on level @p level.
    */
@@ -186,6 +193,15 @@ MGLevelObject<Object>::MGLevelObject(const unsigned int min,
 }
 
 
+template <class Object>
+MGLevelObject<Object>::MGLevelObject(const unsigned int min,
+                                     const unsigned int max)
+  : minlevel(0)
+{
+  resize(min, max);
+}
+
+
 template <class Object>
 Object &MGLevelObject<Object>::operator[](const unsigned int i)
 {

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.