not -> !
This commit is contained in:
parent
b890509ec1
commit
a406d8c5be
@ -125,7 +125,7 @@ struct formatter<std::optional<T>, Char,
|
|||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(std::optional<T> const& opt, FormatContext& ctx) const
|
auto format(std::optional<T> const& opt, FormatContext& ctx) const
|
||||||
-> decltype(ctx.out()) {
|
-> decltype(ctx.out()) {
|
||||||
if (not opt) return detail::write<Char>(ctx.out(), none);
|
if (!opt) return detail::write<Char>(ctx.out(), none);
|
||||||
|
|
||||||
auto out = ctx.out();
|
auto out = ctx.out();
|
||||||
out = detail::write<Char>(out, optional);
|
out = detail::write<Char>(out, optional);
|
||||||
|
|||||||
@ -59,8 +59,7 @@ TEST(std_test, optional) {
|
|||||||
std::optional{3}}),
|
std::optional{3}}),
|
||||||
"[optional(1), optional(2), optional(3)]");
|
"[optional(1), optional(2), optional(3)]");
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
fmt::format("{}", std::optional<std::optional<const char*>>{std::optional{
|
fmt::format("{}", std::optional<std::optional<const char*>>{{"nested"}}),
|
||||||
"nested"}}),
|
|
||||||
"optional(optional(\"nested\"))");
|
"optional(optional(\"nested\"))");
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
fmt::format("{:<{}}", std::optional{std::string{"left aligned"}}, 30),
|
fmt::format("{:<{}}", std::optional{std::string{"left aligned"}}, 30),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user