Cleanup docs
This commit is contained in:
parent
02896dabee
commit
8f0fadfaaa
@ -181,14 +181,12 @@ template and implement ``parse`` and ``format`` methods::
|
|||||||
|
|
||||||
struct point { double x, y; };
|
struct point { double x, y; };
|
||||||
|
|
||||||
template <>
|
template <> struct fmt::formatter<point> {
|
||||||
struct fmt::formatter<point> {
|
|
||||||
// Presentation format: 'f' - fixed, 'e' - exponential.
|
// Presentation format: 'f' - fixed, 'e' - exponential.
|
||||||
char presentation = 'f';
|
char presentation = 'f';
|
||||||
|
|
||||||
// Parses format specifications of the form ['f' | 'e'].
|
// Parses format specifications of the form ['f' | 'e'].
|
||||||
constexpr auto parse(format_parse_context& ctx) {
|
constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
|
||||||
// auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) // c++11
|
|
||||||
// [ctx.begin(), ctx.end()) is a character range that contains a part of
|
// [ctx.begin(), ctx.end()) is a character range that contains a part of
|
||||||
// the format string starting from the format specifications to be parsed,
|
// the format string starting from the format specifications to be parsed,
|
||||||
// e.g. in
|
// e.g. in
|
||||||
@ -215,8 +213,7 @@ template and implement ``parse`` and ``format`` methods::
|
|||||||
// Formats the point p using the parsed format specification (presentation)
|
// Formats the point p using the parsed format specification (presentation)
|
||||||
// stored in this formatter.
|
// stored in this formatter.
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const point& p, FormatContext& ctx) {
|
auto format(const point& p, FormatContext& ctx) -> decltype(ctx.out()) {
|
||||||
// auto format(const point &p, FormatContext &ctx) -> decltype(ctx.out()) // c++11
|
|
||||||
// ctx.out() is an output iterator to write to.
|
// ctx.out() is an output iterator to write to.
|
||||||
return format_to(
|
return format_to(
|
||||||
ctx.out(),
|
ctx.out(),
|
||||||
|
Loading…
Reference in New Issue
Block a user