Changeset View
Changeset View
Standalone View
Standalone View
src/serialize.h
Show First 20 Lines • Show All 987 Lines • ▼ Show 20 Lines | template <typename T> size_t GetSerializeSize(const T &t, int nVersion = 0) { | ||||
return (CSizeComputer(nVersion) << t).size(); | return (CSizeComputer(nVersion) << t).size(); | ||||
} | } | ||||
template <typename S, typename T> | template <typename S, typename T> | ||||
size_t GetSerializeSize(const S &s, const T &t) { | size_t GetSerializeSize(const S &s, const T &t) { | ||||
return (CSizeComputer(s.GetVersion()) << t).size(); | return (CSizeComputer(s.GetVersion()) << t).size(); | ||||
} | } | ||||
template <typename S, typename... T> | |||||
size_t GetSerializeSizeMany(const S &s, const T &... t) { | |||||
CSizeComputer sc(s.GetVersion()); | |||||
SerializeMany(sc, t...); | |||||
return sc.size(); | |||||
} | |||||
#endif // BITCOIN_SERIALIZE_H | #endif // BITCOIN_SERIALIZE_H |