Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
5415b2a4
Commit
5415b2a4
authored
May 14, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix example.
parent
c3b3c0fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
format.h
format.h
+1
-1
test/format-test.cc
test/format-test.cc
+1
-0
No files found.
format.h
View file @
5415b2a4
...
@@ -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
...
...
test/format-test.cc
View file @
5415b2a4
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment