]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Redo the explanation of a default constructor. 2930/head
authorDavid Wells <wellsd2@rpi.edu>
Sun, 7 Aug 2016 13:36:11 +0000 (09:36 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 7 Aug 2016 13:36:11 +0000 (09:36 -0400)
clang 3.8 requires this default constructor be present in 98, 11, or 14
modes, which does techically follow the standard (section 8.5).

examples/step-4/step-4.cc

index bec2af5372f1ce5bc350cce026d4bfdbde6ec860..f50a1499ed793af413ddbcd9f890cd4f0a4a39e8 100644 (file)
@@ -125,11 +125,11 @@ private:
 // what is done in step-5), but since this is a tutorial we inherit from
 // Function for the sake of example.
 //
-// Unfortunately, some compilers (notably clang 3.8) have a bug where they
-// cannot figure out the default constructor (that is, the constructor which
-// takes no arguments) of classes derived from Function. For portability we
-// provide such constructors in all the tutorial programs so that all
-// supported compilers are happy.
+// Unfortunately, we have to explicitly provide a default constructor for this
+// class (even though we do not need the constructor to do anything unusual)
+// to satisfy a strict reading of the C++ language standard. Some compilers
+// (like GCC from version 4.3 onwards) do not require this, but we provide the
+// default constructor so that all supported compilers are happy.
 template <int dim>
 class RightHandSide : public Function<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.