From 1161d566b96b9dfba965c3bd8b8fad5b3702418d Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Mon, 2 May 2016 19:32:11 -0700 Subject: [PATCH] minor code cleaning --- lib/serialisation/BaseIO.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/serialisation/BaseIO.h b/lib/serialisation/BaseIO.h index 3c49692f..6deb17f5 100644 --- a/lib/serialisation/BaseIO.h +++ b/lib/serialisation/BaseIO.h @@ -49,6 +49,24 @@ namespace Grid { return v; } + // output to streams for vectors + template < class T > + inline std::ostream & operator<<(std::ostream &os, const std::vector &v) + { + os << "["; + for (auto &x: v) + { + os << x << " "; + } + if (v.size() > 0) + { + os << "\b"; + } + os << "]"; + + return os; + } + class Serializable {}; // static polymorphism implemented using CRTP idiom @@ -154,23 +172,6 @@ namespace Grid { r.read(s, output); } - template < class T > - inline std::ostream& operator << (std::ostream& os, const std::vector& v) - { - os << "["; - for (auto &x: v) - { - os << x << " "; - } - if (v.size() > 0) - { - os << "\b"; - } - os << "]"; - - return os; - } - // Writer template implementation //////////////////////////////////////////// template Writer::Writer(void)