diff --git a/doc/api.rst b/doc/api.rst index 7e1855a71d7b..31f6eb69fa3a 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -26,6 +26,8 @@ arguments in the resulting string. .. doxygenfunction:: format(CStringRef, ArgList) +.. doxygenfunction:: operator""_format(const char *, std::size_t) + .. _print: .. doxygenfunction:: print(CStringRef, ArgList) diff --git a/doc/build.py b/doc/build.py index e2cea6a33c19..8bd71122225c 100755 --- a/doc/build.py +++ b/doc/build.py @@ -53,7 +53,8 @@ def build_docs(): ALIASES += "endrst=\endverbatim" PREDEFINED = _WIN32=1 \ FMT_USE_VARIADIC_TEMPLATES=1 \ - FMT_USE_RVALUE_REFERENCES=1 + FMT_USE_RVALUE_REFERENCES=1 \ + FMT_USE_USER_DEFINED_LITERALS=1 EXCLUDE_SYMBOLS = fmt::internal::* StringValue write_str '''.format(os.path.dirname(doc_dir))) if p.returncode != 0: diff --git a/doc/index.rst b/doc/index.rst index a890776b2fcb..35c56f04a718 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -165,7 +165,7 @@ Although the library uses C++11 features when available, it also works with olde compilers and standard library implementations. The only thing to keep in mind for C++98 portability: -* Variadic templates: minimum GCC 4.4, Clang 2.9 or VS2013. This feature allow +* Variadic templates: minimum GCC 4.4, Clang 2.9 or VS2013. This feature allows the Format API to accept an unlimited number of arguments. With older compilers the maximum is 15. diff --git a/format.h b/format.h index e5e9153778ce..12654502345e 100644 --- a/format.h +++ b/format.h @@ -3044,6 +3044,16 @@ struct UdlArg { inline namespace literals { +/** + \rst + C++11 literal form of ``fmt::format``. + Requires ``using namespace fmt::literals``. + + **Example**:: + + std::string message = "The answer is {}"_format(42); + \endrst +*/ inline internal::UdlFormat operator"" _format(const char *s, std::size_t) { return {s}; } inline internal::UdlFormat