Commit 5415b2a4 authored by Victor Zverovich's avatar Victor Zverovich

Fix example.

parent c3b3c0fa
...@@ -1728,7 +1728,7 @@ inline Formatter<ANSITerminalSink> PrintColored(Color c, StringRef format) { ...@@ -1728,7 +1728,7 @@ inline Formatter<ANSITerminalSink> PrintColored(Color c, StringRef format) {
**Example**:: **Example**::
std::string message = str(Format("The answer is {}", 42); std::string message = str(Format("The answer is {}", 42));
See also `Format String Syntax`_. See also `Format String Syntax`_.
\endrst \endrst
......
...@@ -1796,6 +1796,7 @@ TEST(FormatterTest, Examples) { ...@@ -1796,6 +1796,7 @@ TEST(FormatterTest, Examples) {
ReportError("File not found: {0}") << path; ReportError("File not found: {0}") << path;
#if FMT_USE_VARIADIC_TEMPLATES && FMT_USE_RVALUE_REFERENCES #if FMT_USE_VARIADIC_TEMPLATES && FMT_USE_RVALUE_REFERENCES
EXPECT_EQ("The answer is 42", str(Format("The answer is {}", 42)));
EXPECT_THROW_MSG( EXPECT_THROW_MSG(
Format("The answer is {:d}", "forty-two"), FormatError, Format("The answer is {:d}", "forty-two"), FormatError,
"unknown format code 'd' for string"); "unknown format code 'd' for string");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment