From 8f1c66cfde89d67bb0ce47ed671a24101897bfef Mon Sep 17 00:00:00 2001
From: Tobias Schruff <tobias.schruff@gmail.com>
Date: Fri, 3 Nov 2017 19:16:50 +0100
Subject: [PATCH] FieldIterator const-conversion now returns a copy of the
 const_iterator instead of a const reference.

---
 src/field/iterators/FieldIterator.h | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/field/iterators/FieldIterator.h b/src/field/iterators/FieldIterator.h
index a1c328e7..126b8d5c 100644
--- a/src/field/iterators/FieldIterator.h
+++ b/src/field/iterators/FieldIterator.h
@@ -1,15 +1,15 @@
 //======================================================================================================================
 //
-//  This file is part of waLBerla. waLBerla is free software: you can 
+//  This file is part of waLBerla. waLBerla is free software: you can
 //  redistribute it and/or modify it under the terms of the GNU General Public
-//  License as published by the Free Software Foundation, either version 3 of 
+//  License as published by the Free Software Foundation, either version 3 of
 //  the License, or (at your option) any later version.
-//  
-//  waLBerla is distributed in the hope that it will be useful, but WITHOUT 
-//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
+//
+//  waLBerla is distributed in the hope that it will be useful, but WITHOUT
+//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+//  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 //  for more details.
-//  
+//
 //  You should have received a copy of the GNU General Public License along
 //  with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
 //
@@ -91,9 +91,9 @@ namespace field {
       inline bool           operator==( const FieldIterator& it ) const;
       inline bool           operator!=( const FieldIterator& it ) const;
 
-      operator const FieldIterator<const T, fieldFSize> & () const {
-         const FieldIterator<const T, fieldFSize> * ptr;
-         ptr = reinterpret_cast< const FieldIterator<const T, fieldFSize>* > ( this );
+      operator FieldIterator<const T, fieldFSize> () {
+         FieldIterator<const T, fieldFSize> * ptr;
+         ptr = reinterpret_cast< FieldIterator<const T, fieldFSize>* > ( this );
          return *ptr;
       }
 
@@ -304,4 +304,3 @@ namespace field {
 
 
 #include "FieldIterator.impl.h"
-
-- 
GitLab