Use char_traits::length in string_view ctor (#914)

This commit is contained in:
Victor Zverovich
2018-10-24 15:21:21 -07:00
parent 895fb98456
commit f0328f8e36
2 changed files with 6 additions and 15 deletions
+3 -2
View File
@@ -2273,9 +2273,10 @@ struct test_format_string_handler {
bool error = false;
};
FMT_CONSTEXPR bool parse_string(fmt::string_view s) {
template <size_t N>
FMT_CONSTEXPR bool parse_string(const char (&s)[N]) {
test_format_string_handler h;
fmt::internal::parse_format_string<true>(s, h);
fmt::internal::parse_format_string<true>(fmt::string_view(s, N - 1), h);
return !h.error;
}