Reintroduce constexpr fmt::formatted_size for C++20 (#4103)

* Reintroduce constexpr fmt::formatted_size for C++20

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

* Disable constexpr fmt::formatted_size on Visual Studio 2019

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

---------

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
Vladislav Shchapov
2024-08-03 19:13:32 +05:00
committed by GitHub
parent b9c0e4dd82
commit 5ee14d3508
4 changed files with 32 additions and 16 deletions

View File

@ -198,7 +198,7 @@ TEST(compile_test, format_to_n) {
EXPECT_STREQ("2a", buffer);
}
# if 0
# if FMT_USE_CONSTEVAL && (!FMT_MSC_VERSION || FMT_MSC_VERSION >= 1930)
TEST(compile_test, constexpr_formatted_size) {
FMT_CONSTEXPR20 size_t size = fmt::formatted_size(FMT_COMPILE("{}"), 42);
EXPECT_EQ(size, 2);