This class provides a wrapper to enable a streamable type to be used with bsl::format (and std::format) when no formatter specialization is provided (the type is not formattable). Note that it is possible to use this wrapper with types that have a formatter, if the compiler supports it we give a compilation warning directing the user to use the existing formatter instead of wrapping to use the streaming operator.
Declared in <bslfmt_streamed.h>
template<class t_STREAMABLE>
class Streamed;
| Name | Description |
|---|---|
Streamed [constructor] | Constructors |
object | Return a non-modifiable reference to the wrapped object. |
| Name | Description |
|---|---|
BloombergLP::bslfmt::streamed | Create and return a Streamed wrapper for the specified object when t_STREAMABLE2 is already formattable (emits a deprecation warning). |
BloombergLP::bslfmt::streamed | Create and return a Streamed wrapper for the specified object when t_STREAMABLE2 is not formattable. |
| Name | Description |
|---|---|
streamed | Create and return a bslfmt::Streamed (wrapper) object for the specified streamable object. The behavior is undefined unless t_STREAMABLE has a standard and well-behaved std::ostream output operator. This wrapper-creator free function to support compilation with no CTAD (Class Template Argument Deduction); see (#Usage). Notice that for compilations that support the bsl::formattable trait we define two concept-driven overloads of this function, one of which will warn the user (compiler warning) if a bsl::formatter already exists for the type they try to streamed-wrap. |