From e3ad2003326549fa4ce837f68b83dfeeefc25bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= <34161+leolchat@users.noreply.github.com> Date: Wed, 15 Jul 2020 12:03:34 -0700 Subject: [PATCH] Trying to clear ambiguous compile time claims Documentation was a bit misleading. Many people assume that fmt does compile time checks by default, while it requires the use of `FMT_STRING`. It was also unclear that FMT_COMPILE does the same checks. https://github.com/fmtlib/fmt/issues/1772 --- doc/api.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index c3137466..b797886c 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -114,9 +114,12 @@ string checks, wide string, output iterator and user-defined type support. Compile-time Format String Checks --------------------------------- -Compile-time checks are supported for built-in and string types as well as -user-defined types with ``constexpr`` ``parse`` functions in their ``formatter`` -specializations. +Compile-time checks are enabled when using ``FMT_STRING``. It supports built-in +and string types as well as user-defined types with ``constexpr`` ``parse`` +functions in their ``formatter`` specializations. + +When the compiler supports UDL templates extensions, using the litteral string +``""_format()`` will also enable compile-time checks. .. doxygendefine:: FMT_STRING @@ -389,9 +392,10 @@ The format string syntax is described in the documentation of Format string compilation ========================= -``fmt/compile.h`` provides format string compilation support. Format strings -are parsed at compile time and converted into efficient formatting code. This -supports arguments of built-in and string types as well as user-defined types +``fmt/compile.h`` provides format string compilation support when using +``FMT_COMPILE``. Format strings are parsed, checked and converted +into efficient formatting code at compile-time. +This supports arguments of built-in and string types as well as user-defined types with ``constexpr`` ``parse`` functions in their ``formatter`` specializations. Format string compilation can generate more binary code compared to the default API and is only recommended in places where formatting is a performance