diff --git a/format.h b/format.h index b2a6f856..856dbb6c 100644 --- a/format.h +++ b/format.h @@ -1728,7 +1728,7 @@ inline Formatter PrintColored(Color c, StringRef format) { **Example**:: - std::string message = str(Format("The answer is {}", 42); + std::string message = str(Format("The answer is {}", 42)); See also `Format String Syntax`_. \endrst diff --git a/test/format-test.cc b/test/format-test.cc index 21bf6b2f..a1570828 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1796,6 +1796,7 @@ TEST(FormatterTest, Examples) { ReportError("File not found: {0}") << path; #if FMT_USE_VARIADIC_TEMPLATES && FMT_USE_RVALUE_REFERENCES + EXPECT_EQ("The answer is 42", str(Format("The answer is {}", 42))); EXPECT_THROW_MSG( Format("The answer is {:d}", "forty-two"), FormatError, "unknown format code 'd' for string");