From: Jean-Paul Pelteret Date: Fri, 8 Jan 2016 23:26:28 +0000 (+0100) Subject: Tensor::operator<< for dim==0 now accesses values by reference. X-Git-Tag: v8.4.0-rc2~104^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2047%2Fhead;p=dealii.git Tensor::operator<< for dim==0 now accesses values by reference. This is done instead of making a copy, and is useful when non-trivial number types (e.g. auto-differentiable) are stored. --- diff --git a/doc/news/changes.h b/doc/news/changes.h index 372805040d..7e93d38360 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -199,7 +199,9 @@ inconvenience this causes.

General

  1. Fixed: Tensor::operator[] that takes TableIndices as a parameter no - longer returns by value, but rather by reference. + longer returns by value, but rather by reference. Tensor::operator<< for + dim==0 now accesses values by reference instead of making a copy. This is + useful when non-trivial number types are stored.
    (Jean-Paul Pelteret, 2016/01/08)
  2. diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 7aa7c52fc5..3a240f5d53 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1192,7 +1192,7 @@ template inline std::ostream &operator << (std::ostream &out, const Tensor<0,dim,Number> &p) { - out << static_cast(p); + out << static_cast(p); return out; }