[#Using] = Using :mrdocs: Cause serialization/deserialization of an object to be done using a specified formatter class. == Synopsis Declared in `<serialize.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Formatter, typename T> static xref:Wrapper.adoc[Wrapper<Formatter, T&>] Using(T&& t); ---- == Description To use this, you need a class Formatter that has public functions Ser(stream, const object&) for serialization, and Unser(stream, object&) for deserialization. Serialization routines (inside READWRITE, or directly with << and >> operators), can then use Using<Formatter>(object). This works by constructing a Wrapper<Formatter, T>‐wrapped version of object, where T is const during serialization, and non‐const during deserialization, which maintains const correctness. == Return Value A Wrapper that applies the formatter to t. == Parameters [cols="1,4"] |=== | Name| Description | *t* | The object to (de)serialize through the formatter. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#