Formatter to serialize/deserialize vector elements using another formatter
Synopsis
Declared in <serialize.h>
template<class Formatter>
struct VectorFormatter;
Description
Example: struct X { std::vector<uint64_t> v; SERIALIZE_METHODS(X, obj) { READWRITE(Using<VectorFormatter<VarInt>>(obj.v)); } }; will define a struct that contains a vector of uint64_t, which is serialized as a vector of VarInt‐encoded integers.
V is not required to be an std::vector type. It works for any class that exposes a value_type, size, reserve, emplace_back, back, and const iterators.