From 0992a8e18968600c6b22de601bc37caadd64e7f2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 9 Jan 2016 00:26:28 +0100 Subject: [PATCH] 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. --- doc/news/changes.h | 4 +++- include/deal.II/base/tensor.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.39.5