Go to the documentation of this file.
9 #ifndef EAGINE_MEMORY_COPY_HPP
10 #define EAGINE_MEMORY_COPY_HPP
12 #include "../assert.hpp"
17 namespace eagine::memory {
24 EAGINE_ASSERT(dest.size() >= source.size());
25 std::memcpy(dest.data(), source.data(),
std_size(source.size()));
26 return block(dest.data(), source.size());
34 dest.resize(source.size());
40 #endif // EAGINE_MEMORY_COPY_HPP
static auto copy_into(const_block source, buffer &dest) -> block
Copies the content of source block to destination buffer.
Definition: copy.hpp:33
static constexpr auto cover(T *addr, S size) noexcept -> span_if_mutable< T >
Creates a span starting at the specified pointer and specified length.
Definition: span.hpp:465
basic_block< false > block
Alias for non-const byte memory span.
Definition: block.hpp:27
Reallocatable owning byte buffer.
Definition: buffer.hpp:22
static constexpr auto std_size(T v) noexcept
Converts argument to std size type.
Definition: types.hpp:52
Non-owning view of a contiguous range of memory with ValueType elements.
Definition: flatten_fwd.hpp:16
static auto copy(const_block source, block dest) -> block
Copies the content of source block to destination block.
Definition: copy.hpp:23