mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-28 13:19:48 +01:00
Make % an opt-in to improve compatibility with std::format
This commit is contained in:
@@ -195,6 +195,11 @@ FMT_END_NAMESPACE
|
||||
# define FMT_NUMERIC_ALIGN 1
|
||||
#endif
|
||||
|
||||
// Enable the deprecated percent specifier.
|
||||
#ifndef FMT_DEPRECATED_PERCENT
|
||||
# define FMT_DEPRECATED_PERCENT 0
|
||||
#endif
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
namespace internal {
|
||||
|
||||
@@ -1284,8 +1289,10 @@ FMT_CONSTEXPR float_spec parse_float_type_spec(char spec,
|
||||
result.format = float_format::fixed;
|
||||
break;
|
||||
case '%':
|
||||
#if FMT_DEPRECATED_PERCENT
|
||||
result.format = float_format::fixed;
|
||||
result.percent = true;
|
||||
#endif
|
||||
break;
|
||||
case 'A':
|
||||
result.upper = true;
|
||||
|
||||
Reference in New Issue
Block a user