]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid warning for an unused variable in step-20 6845/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 26 Jun 2018 00:28:23 +0000 (02:28 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 26 Jun 2018 07:43:15 +0000 (09:43 +0200)
examples/step-20/step-20.cc

index c14df6ea6c3fe6fd8671cbc87952f593af062ff4..8710392acae2a60350925c3e248d2c63d08560e2 100644 (file)
@@ -253,8 +253,13 @@ namespace Step20
   void KInverse<dim>::value_list(const std::vector<Point<dim>> &points,
                                  std::vector<Tensor<2, dim>> &  values) const
   {
-    Assert(points.size() == values.size(),
-           ExcDimensionMismatch(points.size(), values.size()));
+    // The value we are going to store for a given point does not depend on its
+    // coordinates and we use the `points` object only for checking that the
+    // `values` object has the correct size. In release mode, `AssertDimension`
+    // is defined empty and the compiler will complain that the `points` object
+    // is unused. The following line silences this warning.
+    (void)points;
+    AssertDimension(points.size(), values.size());
 
     for (auto &value : values)
       {

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.