mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-30 16:26:27 +08:00
Style: remove dead code, apply snake_case, and fix newline
This commit is contained in:
parent
2be3e59849
commit
e75368a58b
@ -168,14 +168,6 @@ constexpr auto get_arg_checked(const Args&... args) -> const T& {
|
||||
template <typename Char>
|
||||
struct is_compiled_format<code_unit<Char>> : std::true_type {};
|
||||
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct compile_has_format_as : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct compile_has_format_as<T, void_t<decltype(format_as(std::declval<const T&>()))>> : std::true_type {};
|
||||
|
||||
|
||||
template <typename Char, typename V, int N> struct field {
|
||||
using char_type = Char;
|
||||
|
||||
@ -195,11 +187,6 @@ template <typename Char, typename V, int N> struct field {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename Char, typename T, int N>
|
||||
struct is_compiled_format<field<Char, T, N>> : std::true_type {};
|
||||
|
||||
|
||||
@ -480,16 +480,12 @@ TEST(compile_test, constexpr_string_format) {
|
||||
}
|
||||
#endif // FMT_USE_CONSTEXPR_STRING
|
||||
|
||||
|
||||
|
||||
|
||||
namespace {
|
||||
struct CompileFormatAsType {
|
||||
struct compile_format_as_type {
|
||||
int value;
|
||||
};
|
||||
int format_as(CompileFormatAsType f) { return f.value; }
|
||||
} // namespace
|
||||
|
||||
TEST(CompileTest, FormatAs) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), CompileFormatAsType{42}));
|
||||
int format_as(compile_format_as_type f) { return f.value; }
|
||||
}
|
||||
TEST(compile_test, format_as) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), compile_format_as_type{42}));
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user