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

Detailed Description

Provide a formatter customization for bool type.

Outline

Purpose

Provide a formatter customization for bool type

Classes

Canonical Header

bsl_format.h

Description

This component provides partial specializations of bsl::formatter catering for bool type.

This header is not intended to be included directly. Please include <bsl_format.h> to be able to use the bsl::formatter for bool type.

Usage

In this section we show the intended use of this component.

Example: Formatting a bool

We do not expect most users of bsl::format to interact with this type directly and instead use bsl::format or bsl::vformat, so this example is necessarily unrealistic.

Suppose we want to test this formatter's ability to format a boolean with defined alignment and padding.

mpc.advance_to(f.parse(mpc));
bool value = false;
mfc.advance_to(bsl::as_const(f).format(value, mfc));
assert("false*" == mfc.finalString());
Definition bslfmt_mockformatcontext.h:206
Definition bslfmt_mockparsecontext.h:291
BSLS_KEYWORD_CONSTEXPR bsl::add_const< TYPE >::type & as_const(TYPE &t) BSLS_KEYWORD_NOEXCEPT
Return a reference offering non-modifiable access to the specified t.
Definition bslstl_utility.h:129
Definition bslfmt_formatterbase.h:426