Make compile-time checks in format_to handle references

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

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));
}