From 89b0c71fa9f6478912e44abd68b3bc882273d0b7 Mon Sep 17 00:00:00 2001 From: Daumantas Kavolis <12998363+dkavolis@users.noreply.github.com> Date: Tue, 24 Sep 2019 10:54:32 +0100 Subject: [PATCH] fix name clash in header-only mode --- include/fmt/compile.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index 952c1087..337bed31 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -414,7 +414,7 @@ constexpr concat make_concat(L lhs, R rhs) { return {lhs, rhs}; } -struct unknown {}; +struct unknown_format {}; template constexpr size_t parse_text(basic_string_view str, size_t pos) { @@ -431,7 +431,8 @@ template constexpr auto parse_tail(T head, S format_str) { if constexpr (POS != to_string_view(format_str).size()) { constexpr auto tail = compile_format_string(format_str); - if constexpr (std::is_same, unknown>()) + if constexpr (std::is_same, + unknown_format>()) return tail; else return make_concat(head, tail); @@ -441,7 +442,7 @@ constexpr auto parse_tail(T head, S format_str) { } // Compiles a non-empty format string and returns the compiled representation -// or unknown() on unrecognized input. +// or unknown_format() on unrecognized input. template constexpr auto compile_format_string(S format_str) { using char_type = typename S::char_type; @@ -457,10 +458,10 @@ constexpr auto compile_format_string(S format_str) { return parse_tail(field(), format_str); } else { - return unknown(); + return unknown_format(); } } else { - return unknown(); + return unknown_format(); } } else if constexpr (str[POS] == '}') { if (POS + 1 == str.size()) @@ -488,7 +489,7 @@ constexpr auto compile(S format_str) { internal::compile_format_string, 0, 0>( format_str); if constexpr (std::is_same, - internal::unknown>()) { + internal::unknown_format>()) { return internal::compiled_format(to_string_view(format_str)); } else { return result;