mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-27 04:20:06 +00:00
Update docs
This commit is contained in:
parent
ac85afaab6
commit
afcf424294
@ -94,7 +94,7 @@ types.
|
|||||||
To make a user-defined type formattable, specialize the ``formatter<T>`` struct
|
To make a user-defined type formattable, specialize the ``formatter<T>`` struct
|
||||||
template and implement ``parse`` and ``format`` methods::
|
template and implement ``parse`` and ``format`` methods::
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
struct point {
|
struct point {
|
||||||
double x, y;
|
double x, y;
|
||||||
@ -126,7 +126,7 @@ template and implement ``parse`` and ``format`` methods::
|
|||||||
if (it != end && (*it == 'f' || *it == 'e')) presentation = *it++;
|
if (it != end && (*it == 'f' || *it == 'e')) presentation = *it++;
|
||||||
|
|
||||||
// Check if reached the end of the range:
|
// Check if reached the end of the range:
|
||||||
if (it != end && *it != '}') throw format_error("invalid format");
|
if (it != end && *it != '}') ctx.on_error("invalid format");
|
||||||
|
|
||||||
// Return an iterator past the end of the parsed range:
|
// Return an iterator past the end of the parsed range:
|
||||||
return it;
|
return it;
|
||||||
|
Loading…
Reference in New Issue
Block a user