Improve fmt::format readability

This commit is contained in:
Victor Zverovich 2018-10-05 18:42:02 -07:00
parent 2299032392
commit 041bf83d9b
2 changed files with 10 additions and 3 deletions

View File

@ -92,7 +92,8 @@ def build_docs(version='dev', **kwargs):
FMT_API= \ FMT_API= \
"FMT_BEGIN_NAMESPACE=namespace fmt {{" \ "FMT_BEGIN_NAMESPACE=namespace fmt {{" \
"FMT_END_NAMESPACE=}}" \ "FMT_END_NAMESPACE=}}" \
"FMT_STRING_ALIAS=1" "FMT_STRING_ALIAS=1" \
"FMT_CHAR(S)=char_t<S>"
EXCLUDE_SYMBOLS = fmt::internal::* StringValue write_str EXCLUDE_SYMBOLS = fmt::internal::* StringValue write_str
'''.format(include_dir, doxyxml_dir).encode('UTF-8')) '''.format(include_dir, doxyxml_dir).encode('UTF-8'))
if p.returncode != 0: if p.returncode != 0:

View File

@ -505,8 +505,6 @@ struct is_format_string : std::is_empty<format_string_traits<S>> {};
template <typename S> template <typename S>
struct is_compile_string : std::is_base_of<compile_string, S> {}; struct is_compile_string : std::is_base_of<compile_string, S> {};
#define FMT_CHAR(Str) typename internal::format_string_traits<Str>::char_type
template <typename Char> template <typename Char>
struct named_arg_base; struct named_arg_base;
@ -1246,6 +1244,14 @@ struct wformat_args : basic_format_args<wformat_context> {
: basic_format_args<wformat_context>(std::forward<Args>(arg)...) {} : basic_format_args<wformat_context>(std::forward<Args>(arg)...) {}
}; };
#if FMT_HAS_FEATURE(cxx_alias_templates)
template <typename S>
using char_t = typename internal::format_string_traits<S>::char_type;
#define FMT_CHAR(S) char_t<S>
#else
#define FMT_CHAR(S) typename internal::format_string_traits<S>::char_type
#endif
namespace internal { namespace internal {
template <typename Char> template <typename Char>
struct named_arg_base { struct named_arg_base {