[#DifferenceFormatter]
= DifferenceFormatter
:mrdocs:

Formatter that (de)serializes a monotonically increasing sequence as differences&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class DifferenceFormatter;
----

== Description

Successive values are encoded as the gap from the previous value, so a sorted list of indexes stays compact on the wire&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:DifferenceFormatter/Ser.adoc[`Ser`] 
| Writes the next value as its difference from the previous one&period;
| xref:DifferenceFormatter/Unser.adoc[`Unser`] 
| Reads the next value by adding the encoded difference to the running total&period;
|===



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