[#Using]
= Using
:mrdocs:

Cause serialization&sol;deserialization of an object to be done using a specified formatter class&period;

== Synopsis

Declared in `&lt;serialize&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Formatter,
    typename T&gt;
static
xref:Wrapper.adoc[Wrapper&lt;Formatter, T&&gt;]
Using(T&& t);
----

== Description

To use this, you need a class Formatter that has public functions Ser(stream, const object&amp;) for serialization, and Unser(stream, object&amp;) for deserialization&period; Serialization routines (inside READWRITE, or directly with &lt;&lt; and &gt;&gt; operators), can then use Using&lt;Formatter&gt;(object)&period;

This works by constructing a Wrapper&lt;Formatter, T&gt;&hyphen;wrapped version of object, where T is const during serialization, and non&hyphen;const during deserialization, which maintains const correctness&period;

== Return Value

A Wrapper that applies the formatter to t&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *t*
| The object to (de)serialize through the formatter&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
