Skip to content

Commit 99292ee

Browse files
cppguruGitHub Enterprise
authored andcommitted
Restore bslfmt::streamed warning support (#5526)
* Restore bslfmt::streamed warning support * Warning demo. * Undo warning testing changes.
1 parent 186deab commit 99292ee

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

groups/bsl/bslfmt/bslfmt_streamed.h

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ BSLS_IDENT("$Id: $")
6565
#include <bslscm_version.h>
6666

6767
#include <bslfmt_format.h>
68+
#include <bslfmt_formattable.h>
6869
#include <bslfmt_streamedformatter.h>
6970

7071
#include <bsls_deprecatefeature.h>
@@ -73,9 +74,28 @@ BSLS_IDENT("$Id: $")
7374
namespace BloombergLP {
7475
namespace bslfmt {
7576

76-
// ========
77-
// Streamed
78-
// ========
77+
#ifdef BSL_FORMATTABLE_DEFINED
78+
79+
#define BSLFMT_STREAMED_INSTANCE_DEPRECATED_ \
80+
BSLS_DEPRECATE_FEATURE( \
81+
"bslfmt", \
82+
"streamed", \
83+
"There is already a formatter available for the specified type, " \
84+
"please use that instead of streaming.")
85+
86+
// =======================================
87+
// struct Streamed_NoWarningConstructorTag
88+
// =======================================
89+
90+
/// A *component private* tag type used to internally construct a `Streamed`
91+
/// object without a warning (about an already existing formatter).
92+
struct Streamed_NoWarningConstructorTag {
93+
};
94+
#endif // BSL_FORMATTABLE_DEFINED
95+
96+
// ==============
97+
// class Streamed
98+
// ==============
7999

80100
/// This class provides a wrapper to enable a streamable type to be used with
81101
/// `bsl::format` (and `std::format`) when no formatter specialization is
@@ -170,9 +190,9 @@ Streamed<t_STREAMABLE> streamed(const t_STREAMABLE& object);
170190
// INLINE DEFINITIONS
171191
// ============================================================================
172192

173-
// --------
174-
// Streamed
175-
// --------
193+
// --------------
194+
// class Streamed
195+
// --------------
176196

177197
// PRIVATE CREATORS
178198
#ifdef BSL_FORMATTABLE_DEFINED

0 commit comments

Comments
 (0)