]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Remove superfluous operator<< and fix ambiguity
authorMatthias Maier <tamiko@43-1.org>
Fri, 4 Sep 2015 05:43:46 +0000 (00:43 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 7 Sep 2015 18:36:22 +0000 (13:36 -0500)
include/deal.II/base/tensor.h

index a338636851643032ee44be2bdb1299a933770ef6..a2a3ba0f8a395b146369a765abfd71299b7637af 100644 (file)
@@ -41,26 +41,12 @@ template <int rank_, int dim, typename Number>
 inline
 std::ostream &operator << (std::ostream &out, const Tensor<rank_,dim,Number> &p)
 {
-  for (unsigned int i=0; i<dim-1; ++i)
-    out << p[i] << ' ';
-  out << p[dim-1];
-
-  return out;
-}
-
-
-/**
- * Output operator for tensors and dimension 1. This is implemented
- * specialized from the general template in order to avoid a compiler
- * warning that the loop is empty.
- *
- * @relates Tensor
- */
-template <int rank_>
-inline
-std::ostream &operator << (std::ostream &out, const Tensor<rank_,1> &p)
-{
-  out << p[0];
+  for (unsigned int i = 0; i < dim; ++i)
+    {
+      out << p[i];
+      if (i != dim - 1)
+        out << ' ';
+    }
 
   return out;
 }

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.