1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-07-29 10:47:07 +01:00

Merge branch 'hadrons' into feature/hadrons

This commit is contained in:
2016-06-14 17:51:15 +01:00
45 changed files with 4635 additions and 22 deletions

View File

@@ -67,9 +67,8 @@ namespace Grid {
return os;
}
class Serializable {};
// static polymorphism implemented using CRTP idiom
class Serializable;
// Static abstract writer
template <typename T>
@@ -122,6 +121,27 @@ namespace Grid {
T *upcast;
};
// serializable base class
class Serializable
{
public:
template <typename T>
static inline void write(Writer<T> &WR,const std::string &s,
const Serializable &obj)
{}
template <typename T>
static inline void read(Reader<T> &RD,const std::string &s,
Serializable &obj)
{}
friend inline std::ostream & operator<<(std::ostream &os,
const Serializable &obj)
{
return os;
}
};
// Generic writer interface
template <typename T>
inline void push(Writer<T> &w, const std::string &s)