C++20 Port #5

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

View File

@ -21,6 +21,12 @@ export namespace core {
this->buffer[max] = max;
}
template<usize text_size> constexpr path(char const(&text)[text_size]) {
static_assert(text_size <= max, "path cannot be longer than maximum length");
copy(this->buffer, text.as_bytes());
zero(slice{this->buffer}.sliced(text_size, max - text_size));
}
/**
* Returns the base pointer of the path name.
*/