mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-11 22:50:45 +01:00
minor code cleaning
This commit is contained in:
parent
c698b16d75
commit
1161d566b9
@ -49,6 +49,24 @@ namespace Grid {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// output to streams for vectors
|
||||||
|
template < class T >
|
||||||
|
inline std::ostream & operator<<(std::ostream &os, const std::vector<T> &v)
|
||||||
|
{
|
||||||
|
os << "[";
|
||||||
|
for (auto &x: v)
|
||||||
|
{
|
||||||
|
os << x << " ";
|
||||||
|
}
|
||||||
|
if (v.size() > 0)
|
||||||
|
{
|
||||||
|
os << "\b";
|
||||||
|
}
|
||||||
|
os << "]";
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
class Serializable {};
|
class Serializable {};
|
||||||
|
|
||||||
// static polymorphism implemented using CRTP idiom
|
// static polymorphism implemented using CRTP idiom
|
||||||
@ -154,23 +172,6 @@ namespace Grid {
|
|||||||
r.read(s, output);
|
r.read(s, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
template < class T >
|
|
||||||
inline std::ostream& operator << (std::ostream& os, const std::vector<T>& v)
|
|
||||||
{
|
|
||||||
os << "[";
|
|
||||||
for (auto &x: v)
|
|
||||||
{
|
|
||||||
os << x << " ";
|
|
||||||
}
|
|
||||||
if (v.size() > 0)
|
|
||||||
{
|
|
||||||
os << "\b";
|
|
||||||
}
|
|
||||||
os << "]";
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Writer template implementation ////////////////////////////////////////////
|
// Writer template implementation ////////////////////////////////////////////
|
||||||
template <typename T>
|
template <typename T>
|
||||||
Writer<T>::Writer(void)
|
Writer<T>::Writer(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user