Write docs.

This commit is contained in:
Victor Zverovich 2014-08-21 07:30:00 -07:00
parent da0293c4dd
commit f9561671cf
3 changed files with 23 additions and 0 deletions

View File

@ -31,6 +31,8 @@ namespace is usually omitted in examples.
.. doxygenfunction:: fmt::print(std::FILE *, StringRef, const ArgList &)
.. doxygenfunction:: fmt::print(std::ostream &, StringRef, const ArgList &)
.. doxygendefine:: FMT_VARIADIC
.. doxygenclass:: fmt::BasicWriter

View File

@ -2004,6 +2004,18 @@ inline void format_decimal(char *&buffer, T value) {
fmt::print(format, args);
}
FMT_VARIADIC(void, print_error, const char *, int, const char *)
``FMT_VARIADIC`` is used for compatibility with legacy C++ compilers that
don't implement variadic templates. You don't have to use this macro if
you don't need legacy compiler support and can use variadic templates
directly::
template<typename... Args>
void print_error(const char *file, int line, const char *format,
const Args & ... args) {
fmt::print("{}: {}: ", file, line);
fmt::print(format, args...);
}
\endrst
*/
#define FMT_VARIADIC(ReturnType, func, ...) \

View File

@ -1545,3 +1545,12 @@ TEST(FormatTest, ArgConverter) {
ArgConverter<fmt::LongLong>(arg, 'd').visit(arg);
EXPECT_EQ(Arg::LONG_LONG, arg.type);
}
#if FMT_USE_VARIADIC_TEMPLATES
template<typename... Args>
void print_error(const char *file, int line, const char *format,
const Args & ... args) {
fmt::print("{}: {}: ", file, line);
fmt::print(format, args...);
}
#endif