version 2.28.1

CMake pip_code_model now accept optional NAME field
PIByteArray helpers:
 * piSerialize
 * piDeserialize
This commit is contained in:
2021-08-01 22:11:24 +03:00
parent 4236ca87b1
commit d7ace8bdb1
3 changed files with 39 additions and 18 deletions

View File

@@ -555,10 +555,27 @@ inline PIByteArray & operator >>(PIByteArray & s, T & ) {
return s;
}
template<> inline uint piHash(const PIByteArray & ba) {return ba.hash();}
template<> inline void piSwap(PIByteArray & f, PIByteArray & s) {f.swap(s);}
template <typename T> PIByteArray piSerialize(const T & value) {
PIByteArray ret;
ret << value;
return ret;
}
template <typename T> T piDeserialize(const PIByteArray & data) {
T ret;
if (!data.isEmpty()) {
PIByteArray ba(data);
ba >> ret;
}
return ret;
}
#undef _TYPENAME_