mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-06 23:30:29 +00:00
Update example.
This commit is contained in:
parent
e882db900d
commit
afc760263e
12
format.h
12
format.h
@ -2195,14 +2195,12 @@ inline void FormatDec(char *&buffer, T value) {
|
|||||||
|
|
||||||
**Example**::
|
**Example**::
|
||||||
|
|
||||||
std::string FormatMessage(int id, const char *format,
|
void print_error(const char *file, int line, const char *format,
|
||||||
const fmt::ArgList &args) {
|
const fmt::ArgList &args) {
|
||||||
fmt::Writer w;
|
fmt::print("{}: {}: ", file, line);
|
||||||
w.format("[{}] ", id);
|
fmt::print(format, args);
|
||||||
w.format(format, args);
|
|
||||||
return w.str();
|
|
||||||
}
|
}
|
||||||
FMT_VARIADIC(std::string, FormatMessage, int, const char *)
|
FMT_VARIADIC(void, print_error, const char *, int, const char *)
|
||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
#define FMT_VARIADIC(ReturnType, func, ...) \
|
#define FMT_VARIADIC(ReturnType, func, ...) \
|
||||||
|
Loading…
Reference in New Issue
Block a user