mirror of
https://github.com/fmtlib/fmt.git
synced 2025-12-14 09:39:08 +01:00
Fix formatting of objects convertible to string_view
This commit is contained in:
@@ -1223,6 +1223,14 @@ TEST(FormatterTest, FormatConvertibleToString) {
|
||||
EXPECT_EQ("foo", format("{}", ConvertibleToString()));
|
||||
}
|
||||
|
||||
struct ConvertibleToStringView {
|
||||
operator fmt::string_view() const { return "foo"; }
|
||||
};
|
||||
|
||||
TEST(FormatterTest, FormatConvertibleToStringView) {
|
||||
EXPECT_EQ("foo", format("{}", ConvertibleToStringView()));
|
||||
}
|
||||
|
||||
namespace fmt {
|
||||
template <>
|
||||
struct formatter<Date> {
|
||||
|
||||
Reference in New Issue
Block a user