This commit is contained in:
mccakit 2026-07-21 16:50:23 +03:00
parent 52f096b6b9
commit 9ffbbed10c
3 changed files with 15 additions and 12 deletions

View File

@ -1010,14 +1010,14 @@ constexpr auto in(type t, int set) -> bool {
// Bitsets of types.
enum {
sint_set =
set(type::int_type) | set(type::long_long_type) | set(type::int128_type),
sint_set = set(type::int_type) | set(type::long_long_type) |
set(type::int128_type),
uint_set = set(type::uint_type) | set(type::ulong_long_type) |
set(type::uint128_type),
set(type::uint128_type),
bool_set = set(type::bool_type),
char_set = set(type::char_type),
float_set = set(type::float_type) | set(type::double_type) |
set(type::long_double_type),
set(type::long_double_type),
string_set = set(type::string_type),
cstring_set = set(type::cstring_type),
pointer_set = set(type::pointer_type)
@ -2616,7 +2616,9 @@ template <typename Char = char> struct runtime_format_string {
* // Check format string at runtime instead of compile-time.
* fmt::print(fmt::runtime("{:d}"), "I am not a number");
*/
inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }
inline auto runtime(string_view s) -> runtime_format_string<> {
return {{s}};
}
/// A compile-time format string. Use `format_string` in the public API to
/// prevent type deduction.

View File

@ -181,11 +181,12 @@ typedef enum {} fmt_signed_char;
(fmt_arg[]) { FMT_MAP(FMT_MAKE_ARG, ##__VA_ARGS__) }
# define FMT_EXPAND(v) v
# define fmt_format(buffer, size, fmt, ...) \
fmt_vformat((buffer), (size), (fmt), \
FMT_EXPAND(FMT_VA_SELECT(FMT_MAKE_NULL, FMT_MAKE_ARGLIST, \
##__VA_ARGS__)(__VA_ARGS__)), \
FMT_NARG(, ##__VA_ARGS__))
# define fmt_format(buffer, size, fmt, ...) \
fmt_vformat( \
(buffer), (size), (fmt), \
FMT_EXPAND(FMT_VA_SELECT( \
FMT_MAKE_NULL, FMT_MAKE_ARGLIST, ##__VA_ARGS__)(__VA_ARGS__)), \
FMT_NARG(, ##__VA_ARGS__))
#endif // __cplusplus

View File

@ -2021,7 +2021,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
int num_digits = 0;
auto buffer = memory_buffer();
switch (specs.type()) {
default: FMT_ASSERT(false, ""); FMT_FALLTHROUGH;
default: FMT_ASSERT(false, ""); FMT_FALLTHROUGH;
case presentation_type::none:
case presentation_type::dec:
num_digits = count_digits(value);
@ -2150,7 +2150,7 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg<T> arg,
auto abs_value = arg.abs_value;
auto prefix = arg.prefix;
switch (specs.type()) {
default: FMT_ASSERT(false, ""); FMT_FALLTHROUGH;
default: FMT_ASSERT(false, ""); FMT_FALLTHROUGH;
case presentation_type::none:
case presentation_type::dec:
begin = do_format_decimal(buffer, abs_value, buffer_size);