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
c48353cb
Commit
c48353cb
authored
Feb 13, 2022
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs
parent
083510f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
doc/api.rst
doc/api.rst
+4
-5
No files found.
doc/api.rst
View file @
c48353cb
...
@@ -493,7 +493,9 @@ System APIs
...
@@ -493,7 +493,9 @@ System APIs
========================
========================
``fmt/ostream.h`` provides ``std::ostream`` support including formatting of
``fmt/ostream.h`` provides ``std::ostream`` support including formatting of
user-defined types that have an overloaded insertion operator (``operator<<``)::
user-defined types that have an overloaded insertion operator (``operator<<``).
In order to make a type formattable via ``std::ostream`` you should provide a
``formatter`` specialization inherited from ``ostream_formatter``:
#include <fmt/ostream.h>
#include <fmt/ostream.h>
...
@@ -507,14 +509,11 @@ user-defined types that have an overloaded insertion operator (``operator<<``)::
...
@@ -507,14 +509,11 @@ user-defined types that have an overloaded insertion operator (``operator<<``)::
}
}
};
};
template <> struct fmt::formatter<date> : ostream_formatter
<date>
{};
template <> struct fmt::formatter<date> : ostream_formatter {};
std::string s = fmt::format("The date is {}", date(2012, 12, 9));
std::string s = fmt::format("The date is {}", date(2012, 12, 9));
// s == "The date is 2012-12-9"
// s == "The date is 2012-12-9"
{fmt} only supports insertion operators that are defined in the same namespaces
as the types they format and can be found with the argument-dependent lookup.
.. doxygenfunction:: print(std::basic_ostream<Char> &os, const S &format_str, Args&&... args)
.. doxygenfunction:: print(std::basic_ostream<Char> &os, const S &format_str, Args&&... args)
.. _printf-api:
.. _printf-api:
...
...
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