Apply clang-format
* use clang-format v17.0.6 to reformat the tree * tweak some places so that clang-format does not mutate the layout of code too much Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
parent
89860eb901
commit
37dd224627
@ -563,9 +563,10 @@ OutputIt vformat_to(
|
|||||||
fmt::emphasis::bold | fg(fmt::color::red), "{}", 42);
|
fmt::emphasis::bold | fg(fmt::color::red), "{}", 42);
|
||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
template <typename OutputIt, typename S, typename... Args,
|
template <
|
||||||
bool enable = detail::is_output_iterator<OutputIt, char_t<S>>::value&&
|
typename OutputIt, typename S, typename... Args,
|
||||||
detail::is_string<S>::value>
|
bool enable = detail::is_output_iterator<OutputIt, char_t<S>>::value &&
|
||||||
|
detail::is_string<S>::value>
|
||||||
inline auto format_to(OutputIt out, const text_style& ts, const S& format_str,
|
inline auto format_to(OutputIt out, const text_style& ts, const S& format_str,
|
||||||
Args&&... args) ->
|
Args&&... args) ->
|
||||||
typename std::enable_if<enable, OutputIt>::type {
|
typename std::enable_if<enable, OutputIt>::type {
|
||||||
|
|||||||
@ -2429,7 +2429,8 @@ FMT_CONSTEXPR FMT_INLINE auto parse_format_specs(
|
|||||||
case 'G':
|
case 'G':
|
||||||
return parse_presentation_type(pres::general_upper, float_set);
|
return parse_presentation_type(pres::general_upper, float_set);
|
||||||
case 'c':
|
case 'c':
|
||||||
if (arg_type == type::bool_type) throw_format_error("invalid format specifier");
|
if (arg_type == type::bool_type)
|
||||||
|
throw_format_error("invalid format specifier");
|
||||||
return parse_presentation_type(pres::chr, integral_set);
|
return parse_presentation_type(pres::chr, integral_set);
|
||||||
case 's':
|
case 's':
|
||||||
return parse_presentation_type(pres::string,
|
return parse_presentation_type(pres::string,
|
||||||
|
|||||||
@ -984,7 +984,7 @@ template <> struct cache_accessor<double> {
|
|||||||
{0xe0accfa875af45a7, 0x93eb1b80a33b8606},
|
{0xe0accfa875af45a7, 0x93eb1b80a33b8606},
|
||||||
{0x8c6c01c9498d8b88, 0xbc72f130660533c4},
|
{0x8c6c01c9498d8b88, 0xbc72f130660533c4},
|
||||||
{0xaf87023b9bf0ee6a, 0xeb8fad7c7f8680b5},
|
{0xaf87023b9bf0ee6a, 0xeb8fad7c7f8680b5},
|
||||||
{0xdb68c2ca82ed2a05, 0xa67398db9f6820e2}
|
{0xdb68c2ca82ed2a05, 0xa67398db9f6820e2},
|
||||||
#else
|
#else
|
||||||
{0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b},
|
{0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b},
|
||||||
{0xce5d73ff402d98e3, 0xfb0a3d212dc81290},
|
{0xce5d73ff402d98e3, 0xfb0a3d212dc81290},
|
||||||
@ -1009,7 +1009,7 @@ template <> struct cache_accessor<double> {
|
|||||||
{0xe4d5e82392a40515, 0x0fabaf3feaa5334b},
|
{0xe4d5e82392a40515, 0x0fabaf3feaa5334b},
|
||||||
{0xb8da1662e7b00a17, 0x3d6a751f3b936244},
|
{0xb8da1662e7b00a17, 0x3d6a751f3b936244},
|
||||||
{0x95527a5202df0ccb, 0x0f37801e0c43ebc9},
|
{0x95527a5202df0ccb, 0x0f37801e0c43ebc9},
|
||||||
{0xf13e34aabb430a15, 0x647726b9e7c68ff0}
|
{0xf13e34aabb430a15, 0x647726b9e7c68ff0},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,7 @@ void format_value(buffer<Char>& buf, const T& value) {
|
|||||||
auto&& format_buf = formatbuf<std::basic_streambuf<Char>>(buf);
|
auto&& format_buf = formatbuf<std::basic_streambuf<Char>>(buf);
|
||||||
auto&& output = std::basic_ostream<Char>(&format_buf);
|
auto&& output = std::basic_ostream<Char>(&format_buf);
|
||||||
#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
|
#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
|
||||||
output.imbue(std::locale::classic()); // The default is always unlocalized.
|
output.imbue(std::locale::classic()); // The default is always unlocalized.
|
||||||
#endif
|
#endif
|
||||||
output << value;
|
output << value;
|
||||||
output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
|
output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
|
||||||
|
|||||||
@ -137,8 +137,9 @@ template <typename Char> struct formatter<std::filesystem::path, Char> {
|
|||||||
debug_ = true;
|
debug_ = true;
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
if (it != end && (*it == 'g' || *it == 'n'))
|
if (it != end && (*it == 'g' || *it == 'n')) {
|
||||||
path_type_ = *it++;
|
path_type_ = *it++;
|
||||||
|
}
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,8 +247,7 @@ FMT_END_NAMESPACE
|
|||||||
#ifdef __cpp_lib_source_location
|
#ifdef __cpp_lib_source_location
|
||||||
FMT_BEGIN_NAMESPACE
|
FMT_BEGIN_NAMESPACE
|
||||||
FMT_EXPORT
|
FMT_EXPORT
|
||||||
template<>
|
template <> struct formatter<std::source_location> {
|
||||||
struct formatter<std::source_location> {
|
|
||||||
template <typename ParseContext> FMT_CONSTEXPR auto parse(ParseContext& ctx) {
|
template <typename ParseContext> FMT_CONSTEXPR auto parse(ParseContext& ctx) {
|
||||||
return ctx.begin();
|
return ctx.begin();
|
||||||
}
|
}
|
||||||
@ -384,7 +384,7 @@ template <typename Char> struct formatter<std::error_code, Char> {
|
|||||||
FMT_EXPORT
|
FMT_EXPORT
|
||||||
template <typename T, typename Char>
|
template <typename T, typename Char>
|
||||||
struct formatter<
|
struct formatter<
|
||||||
T, Char, // DEPRECATED! Mixing code unit types.
|
T, Char, // DEPRECATED! Mixing code unit types.
|
||||||
typename std::enable_if<std::is_base_of<std::exception, T>::value>::type> {
|
typename std::enable_if<std::is_base_of<std::exception, T>::value>::type> {
|
||||||
private:
|
private:
|
||||||
bool with_typename_ = false;
|
bool with_typename_ = false;
|
||||||
@ -415,7 +415,7 @@ struct formatter<
|
|||||||
# ifdef FMT_HAS_ABI_CXA_DEMANGLE
|
# ifdef FMT_HAS_ABI_CXA_DEMANGLE
|
||||||
int status = 0;
|
int status = 0;
|
||||||
std::size_t size = 0;
|
std::size_t size = 0;
|
||||||
std::unique_ptr<char, void(*)(void*)> demangled_name_ptr(
|
std::unique_ptr<char, void (*)(void*)> demangled_name_ptr(
|
||||||
abi::__cxa_demangle(ti.name(), nullptr, &size, &status), &std::free);
|
abi::__cxa_demangle(ti.name(), nullptr, &size, &status), &std::free);
|
||||||
|
|
||||||
string_view demangled_name_view;
|
string_view demangled_name_view;
|
||||||
|
|||||||
@ -172,11 +172,11 @@ inline auto vformat_to(
|
|||||||
return detail::get_iterator(buf, out);
|
return detail::get_iterator(buf, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <
|
template <typename OutputIt, typename Locale, typename S, typename... T,
|
||||||
typename OutputIt, typename Locale, typename S, typename... T,
|
typename Char = char_t<S>,
|
||||||
typename Char = char_t<S>,
|
bool enable = detail::is_output_iterator<OutputIt, Char>::value &&
|
||||||
bool enable = detail::is_output_iterator<OutputIt, Char>::value&&
|
detail::is_locale<Locale>::value &&
|
||||||
detail::is_locale<Locale>::value&& detail::is_exotic_char<Char>::value>
|
detail::is_exotic_char<Char>::value>
|
||||||
inline auto format_to(OutputIt out, const Locale& loc, const S& format_str,
|
inline auto format_to(OutputIt out, const Locale& loc, const S& format_str,
|
||||||
T&&... args) ->
|
T&&... args) ->
|
||||||
typename std::enable_if<enable, OutputIt>::type {
|
typename std::enable_if<enable, OutputIt>::type {
|
||||||
|
|||||||
@ -101,7 +101,7 @@ extern "C++" {
|
|||||||
|
|
||||||
// gcc doesn't yet implement private module fragments
|
// gcc doesn't yet implement private module fragments
|
||||||
#if !FMT_GCC_VERSION
|
#if !FMT_GCC_VERSION
|
||||||
module : private;
|
module :private;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "format.cc"
|
#include "format.cc"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user