File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ using Alloc = Mallocator<"File IO">;
1010using File_Time = u64 ;
1111
1212[[nodiscard]] Opt<Vec<u8 , Alloc>> read (String_View path) noexcept ;
13- [[nodiscard]] bool write (String_View path, Slice<u8 > data) noexcept ;
13+ [[nodiscard]] bool write (String_View path, Slice<const u8 > data) noexcept ;
1414
1515[[nodiscard]] Opt<File_Time> last_write_time (String_View path) noexcept ;
1616
Original file line number Diff line number Diff line change @@ -118,7 +118,9 @@ struct Slice {
118118 return Slice{data_ + start, length};
119119 }
120120
121- [[nodiscard]] Slice<u8 > to_bytes () noexcept {
121+ [[nodiscard]] Slice<u8 > to_bytes () noexcept
122+ requires(!Const<T>)
123+ {
122124 Slice<u8 > ret;
123125 ret.data_ = launder (reinterpret_cast <u8 *>(data_));
124126 ret.length_ = length_ * sizeof (T);
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ namespace rpp::Files {
7272 return Opt{rpp::move (data)};
7373}
7474
75- [[nodiscard]] bool write (String_View path, Slice<u8 > data) noexcept {
75+ [[nodiscard]] bool write (String_View path, Slice<const u8 > data) noexcept {
7676
7777 auto [ucs2_path, ucs2_path_len] = utf8_to_ucs2 (path);
7878 if (ucs2_path_len == 0 ) {
You can’t perform that action at this time.
0 commit comments