Disable remaining implicit conversions

This commit is contained in:
Victor Zverovich
2023-01-03 11:57:37 -08:00
parent 9ce6480676
commit 9e4a54fa6e
5 changed files with 18 additions and 68 deletions

View File

@@ -168,19 +168,6 @@ TEST(ranges_test, path_like) {
EXPECT_FALSE((fmt::is_range<path_like, char>::value));
}
#ifdef FMT_USE_STRING_VIEW
struct string_like {
const char* begin();
const char* end();
operator fmt::string_view() const { return "foo"; }
operator std::string_view() const { return "foo"; }
};
TEST(ranges_test, format_string_like) {
EXPECT_EQ(fmt::format("{}", string_like()), "foo");
}
#endif // FMT_USE_STRING_VIEW
// A range that provides non-const only begin()/end() to test fmt::join handles
// that.
//
@@ -401,17 +388,6 @@ TEST(ranges_test, escape_string) {
}
}
#ifdef FMT_USE_STRING_VIEW
struct convertible_to_string_view {
operator std::string_view() const { return "foo"; }
};
TEST(ranges_test, escape_convertible_to_string_view) {
EXPECT_EQ(fmt::format("{}", std::vector<convertible_to_string_view>(1)),
"[\"foo\"]");
}
#endif // FMT_USE_STRING_VIEW
template <typename R> struct fmt_ref_view {
R* r;