From 4b37110f578f7b30e859fd43423972d91653d1af Mon Sep 17 00:00:00 2001
From: Max Kahnt <maxka@mi.fu-berlin.de>
Date: Thu, 9 Nov 2017 08:25:55 +0000
Subject: [PATCH] Fix read binary for scalars. Props to Patrick Jaap for
 pointing it out.

---
 dune/matrix-vector/genericvectortools.hh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dune/matrix-vector/genericvectortools.hh b/dune/matrix-vector/genericvectortools.hh
index 62bf76d..067835d 100644
--- a/dune/matrix-vector/genericvectortools.hh
+++ b/dune/matrix-vector/genericvectortools.hh
@@ -75,8 +75,7 @@ struct ScalarSwitch<Scalar, EnableNumber<Scalar>> {
   }
 
   static void readBinary(std::istream& s, Scalar& v) {
-    for(auto&& vi: v)
-      s.read(reinterpret_cast<char*>(&v), sizeof(Scalar));
+    s.read(reinterpret_cast<char*>(&v), sizeof(Scalar));
   }
 
   template <class BitVector>
-- 
GitLab