Simplify compile-time strings

This commit is contained in:
Victor Zverovich
2018-10-28 09:02:03 -07:00
parent 5ee1a4bc8a
commit bdda4d6030
2 changed files with 19 additions and 19 deletions
+5 -5
View File
@@ -472,11 +472,11 @@ struct compile_string {};
template <typename S>
struct is_compile_string : std::is_base_of<compile_string, S> {};
template <typename S, typename Enable = typename std::enable_if<is_compile_string<S>::value>::type>
inline auto to_string_view(const S &s) -> basic_string_view<typename S::char_type> {
typedef typename S::char_type char_type;
return basic_string_view<char_type>{s.data(), s.size() - 1};
}
template <
typename S,
typename Enable = typename std::enable_if<is_compile_string<S>::value>::type>
FMT_CONSTEXPR basic_string_view<typename S::char_type>
to_string_view(const S &s) { return s; }
template <typename Context>
class basic_format_arg;