mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 06:21:00 +00:00
This reverts commit 3aaa25fa70
for
reasons discussed in #622.
This commit is contained in:
parent
5f1c73db7d
commit
6f2769d0b4
@ -3236,7 +3236,7 @@ class udl_formatter {
|
|||||||
# else
|
# else
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
struct udl_formatter {
|
struct udl_formatter {
|
||||||
basic_string_view<Char> str;
|
const Char *str;
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
auto operator()(Args && ... args) const
|
auto operator()(Args && ... args) const
|
||||||
@ -3277,9 +3277,9 @@ constexpr internal::udl_formatter<Char, CHARS...> operator""_format() {
|
|||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
inline internal::udl_formatter<char>
|
inline internal::udl_formatter<char>
|
||||||
operator"" _format(const char *s, std::size_t n) { return {{s, n}}; }
|
operator"" _format(const char *s, std::size_t) { return {s}; }
|
||||||
inline internal::udl_formatter<wchar_t>
|
inline internal::udl_formatter<wchar_t>
|
||||||
operator"" _format(const wchar_t *s, std::size_t n) { return {{s, n}}; }
|
operator"" _format(const wchar_t *s, std::size_t) { return {s}; }
|
||||||
# endif // FMT_UDL_TEMPLATE
|
# endif // FMT_UDL_TEMPLATE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1469,11 +1469,6 @@ TEST(LiteralsTest, Format) {
|
|||||||
EXPECT_EQ(format("{}c{}", "ab", 1), udl_format);
|
EXPECT_EQ(format("{}c{}", "ab", 1), udl_format);
|
||||||
auto udl_format_w = L"{}c{}"_format(L"ab", 1);
|
auto udl_format_w = L"{}c{}"_format(L"ab", 1);
|
||||||
EXPECT_EQ(format(L"{}c{}", L"ab", 1), udl_format_w);
|
EXPECT_EQ(format(L"{}c{}", L"ab", 1), udl_format_w);
|
||||||
|
|
||||||
auto udl_format_null_char = "{}c\0d{}"_format("ab", 1);
|
|
||||||
EXPECT_EQ(format("{}c\0d{}", "ab", 1), udl_format_null_char);
|
|
||||||
auto udl_format_w_null_char = L"{}c\0d{}"_format(L"ab", 1);
|
|
||||||
EXPECT_EQ(format(L"{}c\0d{}", L"ab", 1), udl_format_w_null_char);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(LiteralsTest, NamedArg) {
|
TEST(LiteralsTest, NamedArg) {
|
||||||
@ -1534,7 +1529,6 @@ TEST(FormatTest, CustomArgFormatter) {
|
|||||||
|
|
||||||
TEST(FormatTest, NonNullTerminatedFormatString) {
|
TEST(FormatTest, NonNullTerminatedFormatString) {
|
||||||
EXPECT_EQ("42", format(string_view("{}foo", 2), 42));
|
EXPECT_EQ("42", format(string_view("{}foo", 2), 42));
|
||||||
EXPECT_EQ("42f\0oo", format(string_view("{}f\0oo", 6), 42));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct variant {
|
struct variant {
|
||||||
|
Loading…
Reference in New Issue
Block a user