From 37f599b1a1eb27b493f707233ded7030f8bbf81c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 12 Dec 2018 17:50:50 -0800 Subject: [PATCH] Fix docs --- doc/api.rst | 2 +- doc/build.py | 3 ++- include/fmt/format.h | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 861594ec..aeea1a77 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -184,7 +184,7 @@ output ``operator<<`` when one is defined for a user-defined type. Output iterator support ----------------------- -.. doxygenfunction:: fmt::format_to(OutputIt, const S &, const Args &...) +.. doxygenfunction:: fmt::format_to(OutputIt, const S&, const Args&...) .. doxygenfunction:: fmt::format_to_n(OutputIt, std::size_t, string_view, const Args&...) .. doxygenstruct:: fmt::format_to_n_result :members: diff --git a/doc/build.py b/doc/build.py index e44ad7c3..8bb31414 100755 --- a/doc/build.py +++ b/doc/build.py @@ -93,7 +93,8 @@ def build_docs(version='dev', **kwargs): FMT_API= \ "FMT_BEGIN_NAMESPACE=namespace fmt {{" \ "FMT_END_NAMESPACE=}}" \ - "FMT_STRING_ALIAS=1" + "FMT_STRING_ALIAS=1" \ + "FMT_ENABLE_IF_T(B, T)=T" EXCLUDE_SYMBOLS = fmt::internal::* StringValue write_str '''.format(include_dir, doxyxml_dir).encode('UTF-8')) if p.returncode != 0: diff --git a/include/fmt/format.h b/include/fmt/format.h index 907b3e38..33df6653 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -165,6 +165,8 @@ FMT_END_NAMESPACE # define FMT_USE_TRAILING_RETURN 0 #endif +#define FMT_ENABLE_IF_T(B, T) typename std::enable_if::type + #ifndef FMT_USE_GRISU # define FMT_USE_GRISU 0 //# define FMT_USE_GRISU std::numeric_limits::is_iec559 @@ -3495,9 +3497,9 @@ inline typename std::enable_if::value, \endrst */ template -inline typename std::enable_if< +inline FMT_ENABLE_IF_T( internal::is_string::value && - internal::is_output_iterator::value, OutputIt>::type + internal::is_output_iterator::value, OutputIt) format_to(OutputIt out, const S &format_str, const Args &... args) { internal::check_format_string(format_str); typedef typename format_context_t::type context; @@ -3551,10 +3553,10 @@ inline typename std::enable_if< \endrst */ template -inline typename std::enable_if< +inline FMT_ENABLE_IF_T( internal::is_string::value && internal::is_output_iterator::value, - format_to_n_result>::type + format_to_n_result) format_to_n(OutputIt out, std::size_t n, const S &format_str, const Args &... args) { internal::check_format_string(format_str);