BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlb_optionalprinter

Detailed Description

Provide a suite of helper classes for printing bsl::optional.

Outline

Purpose

Provide a suite of helper classes for printing bsl::optional.

Classes

Description

This component provides utility classes bdlb::OptionalPrinter and bdlb::OptionalPrinterUtil for printing bsl::optional.

The class bdlb::OptionalPrinter can also be used with bsl::format (it defines the bslfmt::EnableStreamedFormatter trait). For information about the supported format options see the `bslfmt` package documentation .

Usage

This section illustrates intended use of this component.

Example 1: Printing bsl::optional to a Stream

In this example, we demonstrate how to use bdlb::OptionalPrinterUtil to print bsl::optional to a stream:

Definition bslstl_optional.h:2043
static OptionalPrinter< TYPE > makePrinter(const bsl::optional< TYPE > &data)
Return an OptionalPrinter that prints the specified data.
Definition bdlb_optionalprinter.h:205