Make compile-time checks in format_to handle references

This commit is contained in:
Victor Zverovich committed 2020-03-01 07:57:34 -08:00
1 parent 58e6c84f5a
commit 1e8493196e
3 files changed
+6 -5

No files matched your search

+2
View File
@@ -1859,6 +1859,8 @@ TEST(FormatTest, CustomFormatCompileTimeString) {
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), Answer()));
Answer answer;
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), answer));
char buf[10] = {};
fmt::format_to(buf, FMT_STRING("{}"), answer);
const Answer const_answer = Answer();
EXPECT_EQ("42", fmt::format(FMT_STRING("{}"), const_answer));
}