[#BloombergLP-bdld-DatumUtil-safeTypedPrint]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdld.adoc[bdld]::xref:BloombergLP/bdld/DatumUtil.adoc[DatumUtil]::safeTypedPrint
:relfileprefix: ../../../
:mrdocs:

Write the type&hyphen;tagged value of the specified `object` to the specified `outputStream`, allowing cycles&period;

== Synopsis

Declared in `&lt;bdld&lowbar;datumutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
std::ostream&
safeTypedPrint(
    std::ostream& outputStream,
    xref:BloombergLP/bdld/Datum.adoc[Datum] const& object,
    int level = 0,
    int spacesPerLevel = 4);
----

== Description

Write the value of the specified `object` to the specified `outputStream` in a human&hyphen;readable format that is non&hyphen;ambiguous regarding the type of the `bdld&colon;&colon;Datum` value printed, and return a reference to the modifiable `outputStream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects&period; If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period; Note that `safeTypedPrint` explicitly allows self&hyphen; referential data structures, or in other words data structures with cycles, to be printed&period; When a cycle is detected, that subgraph is not printed again&period; Also note that the human&hyphen;readable format is not fully specified, and can change without notice&period;

== Return Value

reference to the modifiable `outputStream`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *outputStream*
| output stream
| *object*
| value to print
| *level*
| initial indentation level
| *spacesPerLevel*
| spaces per indentation level
|===


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