Disable unsafe implicit conversion to std::string (#729)

This commit is contained in:
Victor Zverovich
2018-05-19 07:14:13 -07:00
parent d2bf93fe22
commit d940fa679c
4 changed files with 13 additions and 15 deletions

View File

@@ -629,8 +629,9 @@ inline typename std::enable_if<
template <typename C, typename T, typename Char = typename C::char_type>
inline typename std::enable_if<
!convert_to_int<T, Char>::value &&
!std::is_convertible<T, basic_string_view<Char>>::value &&
!std::is_convertible<T, std::basic_string<Char>>::value,
!std::is_convertible<T, basic_string_view<Char>>::value,
// Implicit conversion to std::string is not handled here because it's
// unsafe: https://github.com/fmtlib/fmt/issues/729
typed_value<C, custom_type>>::type
make_value(const T &val) { return val; }