[#VectorFormatter] = VectorFormatter :mrdocs: Formatter to serialize/deserialize vector elements using another formatter == Synopsis Declared in `<serialize.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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. == Member Functions [cols="1,4"] |=== | Name| Description | xref:VectorFormatter/Ser.adoc[`Ser`] | Serialize a vector‐like container, writing its size then each element via the formatter. | xref:VectorFormatter/Unser.adoc[`Unser`] | Unserialize a vector‐like container, allocating in bounded batches to limit memory use. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#