Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/v/bytes/details/io_placeholder.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class io_placeholder {
, _byte_index(initial_index)
, _remaining_size(max_size_to_write) {}

[[gnu::always_inline]] void write(const char* src, size_t len) {
template<typename T>
[[gnu::always_inline]] void write(const T* src, size_t len)
requires(sizeof(T) == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function needs a doc now that it's not entirely obvious what it is doing.

It will do an element-wise copy from the src array to this placeholder, if T can be assigned to a char, right?

{
details::check_out_of_range(len, _remaining_size);
std::copy_n(src, len, mutable_index());
_remaining_size -= len;
Expand Down