mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 18:57:34 +02:00
Fix for issue #3241
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
committed by
Victor Zverovich
parent
bde1a6070d
commit
e004f1d699
@ -863,7 +863,7 @@ template <typename Char, typename T, typename U,
|
|||||||
FMT_CONSTEXPR auto copy_str(T* begin, T* end, U* out) -> U* {
|
FMT_CONSTEXPR auto copy_str(T* begin, T* end, U* out) -> U* {
|
||||||
if (is_constant_evaluated()) return copy_str<Char, T*, U*>(begin, end, out);
|
if (is_constant_evaluated()) return copy_str<Char, T*, U*>(begin, end, out);
|
||||||
auto size = to_unsigned(end - begin);
|
auto size = to_unsigned(end - begin);
|
||||||
memcpy(out, begin, size * sizeof(U));
|
if (size > 0) memcpy(out, begin, size * sizeof(U));
|
||||||
return out + size;
|
return out + size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2047,6 +2047,10 @@ TEST(format_test, to_string) {
|
|||||||
#if FMT_USE_FLOAT128
|
#if FMT_USE_FLOAT128
|
||||||
EXPECT_EQ(fmt::to_string(__float128(0.5)), "0.5");
|
EXPECT_EQ(fmt::to_string(__float128(0.5)), "0.5");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(FMT_USE_STRING_VIEW) && FMT_CPLUSPLUS >= 201703L
|
||||||
|
EXPECT_EQ(fmt::to_string(std::string_view()), "");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(format_test, output_iterators) {
|
TEST(format_test, output_iterators) {
|
||||||
|
Reference in New Issue
Block a user