Skip to content

Commit

Permalink
c++11 use formatting user-defined types (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiapengwen authored Jun 11, 2020
1 parent 100e8af commit f904e8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ template and implement ``parse`` and ``format`` methods::

// Parses format specifications of the form ['f' | 'e'].
constexpr auto parse(format_parse_context& ctx) {
// auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) //c++11
// [ctx.begin(), ctx.end()) is a character range that contains a part of
// the format string starting from the format specifications to be parsed,
// e.g. in
Expand Down Expand Up @@ -163,6 +164,7 @@ template and implement ``parse`` and ``format`` methods::
// stored in this formatter.
template <typename FormatContext>
auto format(const point& p, FormatContext& ctx) {
// auto format(const point &p, FormatContext &ctx) -> decltype(ctx.out()) //c++11
// ctx.out() is an output iterator to write to.
return format_to(
ctx.out(),
Expand Down

0 comments on commit f904e8a

Please sign in to comment.