Add UDL as replacement for FMT_COMPILE (#2043)

This commit is contained in:
Alexey Ochapov
2020-12-08 02:53:11 +03:00
committed by GitHub
parent a6fafe2f01
commit 5de0bc1d4f
2 changed files with 46 additions and 0 deletions

View File

@@ -179,6 +179,14 @@ TEST(CompileTest, Empty) {
}
#endif
#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
TEST(CompileTest, CompileFormatStringLiteral) {
using namespace fmt::literals;
EXPECT_EQ("", fmt::format(""_cf));
EXPECT_EQ("42", fmt::format("{}"_cf, 42));
}
#endif
#if __cplusplus >= 202002L
template <size_t max_string_length> struct test_string {
template <typename T> constexpr bool operator==(const T& rhs) const noexcept {