mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-27 03:21:34 +00:00
Simplify _cf
This commit is contained in:
parent
c10fffecdc
commit
0b7c045a2f
@ -589,12 +589,10 @@ void print(const S& format_str, const Args&... args) {
|
||||
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
inline namespace literals {
|
||||
template <detail_exported::fixed_string Str>
|
||||
constexpr detail::udl_compiled_string<
|
||||
remove_cvref_t<decltype(Str.data[0])>,
|
||||
sizeof(Str.data) / sizeof(decltype(Str.data[0])), Str>
|
||||
operator""_cf() {
|
||||
return {};
|
||||
template <detail_exported::fixed_string Str> constexpr auto operator""_cf() {
|
||||
using char_t = remove_cvref_t<decltype(Str.data[0])>;
|
||||
return detail::udl_compiled_string<char_t, sizeof(Str.data) / sizeof(char_t),
|
||||
Str>();
|
||||
}
|
||||
} // namespace literals
|
||||
#endif
|
||||
|
@ -894,7 +894,6 @@ FMT_DEPRECATED FMT_INLINE auto make_args_checked(
|
||||
return {args...};
|
||||
}
|
||||
|
||||
// compile-time support
|
||||
namespace detail_exported {
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
|
||||
template <typename Char, size_t N> struct fixed_string {
|
||||
@ -902,7 +901,7 @@ template <typename Char, size_t N> struct fixed_string {
|
||||
detail::copy_str<Char, const Char*, Char*>(static_cast<const Char*>(str),
|
||||
str + N, data);
|
||||
}
|
||||
Char data[N]{};
|
||||
Char data[N] = {};
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -3151,7 +3150,8 @@ void vformat_to(
|
||||
buffer_context<Char> context;
|
||||
|
||||
format_handler(buffer_appender<Char> p_out, basic_string_view<Char> str,
|
||||
basic_format_args<buffer_context<Char>> p_args, locale_ref p_loc)
|
||||
basic_format_args<buffer_context<Char>> p_args,
|
||||
locale_ref p_loc)
|
||||
: parse_context(str), context(p_out, p_args, p_loc) {}
|
||||
|
||||
void on_text(const Char* begin, const Char* end) {
|
||||
|
Loading…
Reference in New Issue
Block a user