C++20 Port #5

Merged
kayomn merged 35 commits from cpp-port into main 2023-02-20 02:33:45 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit cba6e26995 - Show all commits

View File

@ -478,7 +478,7 @@ export namespace coral {
* *Note*: safety-checked behavior is triggered if `target` is smaller than `origin`. * *Note*: safety-checked behavior is triggered if `target` is smaller than `origin`.
*/ */
void copy(slice<u8> const & target, slice<u8 const> const & origin) { void copy(slice<u8> const & target, slice<u8 const> const & origin) {
if (target.length < origin.length) coral::unreachable(); if (target.length < origin.length) unreachable();
for (usize i = 0; i < origin.length; i += 1) target[i] = origin[i]; for (usize i = 0; i < origin.length; i += 1) target[i] = origin[i];
} }

View File

@ -179,7 +179,7 @@ export namespace coral {
return append_result::out_of_memory; return append_result::out_of_memory;
} }
coral::copy({buffer, buffer_size}, this->elements.as_bytes()); copy({buffer, buffer_size}, this->elements.as_bytes());
this->elements = {reinterpret_cast<element *>(buffer), requested_capacity}; this->elements = {reinterpret_cast<element *>(buffer), requested_capacity};
} }