[#BloombergLP-bdlb-OptionalPrinter]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::OptionalPrinter
:relfileprefix: ../../
:mrdocs:

Utility for printing `bsl&colon;&colon;optional` to standard output streams&period; This class has `operator&lt;&lt;` defined for it, so it can be used, for example, in `ball` logs&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;optionalprinter&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class OptionalPrinter;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/OptionalPrinter/2constructor.adoc[`OptionalPrinter`]         [.small]#[constructor]#
| Create `OptionalPrinter` with the specified `data`&period;
| xref:BloombergLP/bdlb/OptionalPrinter/print.adoc[`print`] 
| Format this object to the specified output stream&period;
| xref:BloombergLP/bdlb/OptionalPrinter/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;OptionalPrinter, EnableStreamedFormatter&gt;`] 
| Declare that this type enables the streamed formatter&period;
|===



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