Fix formatting of objects convertible to string_view
This commit is contained in:
1 parent
e508e30800
commit
24d249b0b4
2 files changed
+11
-1
No files matched your search
@@ -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