]> https://gitweb.dealii.org/ - dealii.git/commitdiff
State why we need a default constructor in step-7.
authorDavid Wells <wellsd2@rpi.edu>
Fri, 29 Jul 2016 00:19:14 +0000 (20:19 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Fri, 29 Jul 2016 00:21:04 +0000 (20:21 -0400)
The older reason was not quite right, at least as of C++ 2003.

examples/step-7/step-7.cc

index 308c2ac4b04213e2e6d28c534cc13dbfd33285e5..6632a91db0df844750874b3770abf0a6bcda9f0e 100644 (file)
@@ -181,8 +181,8 @@ namespace Step7
   // shape (since it is built into the type of the object itself), so the
   // compiler can catch most size-related mistakes for us.
   //
-  // Just as in previous examples, we are forced by the C++ language
-  // specification to declare a seemingly useless default constructor.
+  // Like in step-4, for compatibility with some compilers we explicitly
+  // declare the default constructor:
   template <int dim>
   class Solution : public Function<dim>,
     protected SolutionBase<dim>

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.