Properly constrain detail::copy optimization (#4474)

This commit is contained in:
Victor Chernyakin
2025-06-21 06:59:35 -07:00
committed by GitHub
parent a5dccffa56
commit 1ef8348070
2 changed files with 29 additions and 1 deletions

View File

@@ -279,6 +279,17 @@ TEST(base_test, is_back_insert_iterator) {
std::front_insert_iterator<std::string>>::value);
}
struct minimal_container {
using value_type = char;
void push_back(char) {}
};
TEST(base_test, copy) {
minimal_container c;
static constexpr char str[] = "a";
fmt::detail::copy<char>(str, str + 1, std::back_inserter(c));
}
TEST(base_test, get_buffer) {
mock_buffer<char> buffer;
void* buffer_ptr = &buffer;