[#BloombergLP-balber-BerEncoder-encodeAny-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::xref:BloombergLP/balber/BerEncoder.adoc[BerEncoder]::encodeAny
:relfileprefix: ../../../
:mrdocs:

Encode the specified non&hyphen;modifiable `value` to the specified `stream`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; If the encoding fails `stream` will be invalidated&period; Note that this function behaves identically to `encode`, but does not instantiate any templates at compile time at the expense of being slightly slower at runtime&semi; see the `balber` package documentation for more details&period;

== Synopsis

Declared in `&lt;balber&lowbar;berencoder&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename TYPE&gt;
int
encodeAny(
    std::ostream& stream,
    TYPE const& value);
----


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