| ... | @@ -232,6 +232,7 @@ test "Allocator alloc and remap with zero-bit type" { | ... | @@ -232,6 +232,7 @@ test "Allocator alloc and remap with zero-bit type" { |
| 232 | /// Copy all of source into dest at position 0. | 232 | /// Copy all of source into dest at position 0. |
| 233 | /// dest.len must be >= source.len. | 233 | /// dest.len must be >= source.len. |
| 234 | /// If the slices overlap, dest.ptr must be <= src.ptr. | 234 | /// If the slices overlap, dest.ptr must be <= src.ptr. |
| | 235 | /// This function is deprecated; use @memmove instead. |
| 235 | pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void { | 236 | pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void { |
| 236 | for (dest[0..source.len], source) |*d, s| d.* = s; | 237 | for (dest[0..source.len], source) |*d, s| d.* = s; |
| 237 | } | 238 | } |
| ... | @@ -239,6 +240,7 @@ pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void { | ... | @@ -239,6 +240,7 @@ pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void { |
| 239 | /// Copy all of source into dest at position 0. | 240 | /// Copy all of source into dest at position 0. |
| 240 | /// dest.len must be >= source.len. | 241 | /// dest.len must be >= source.len. |
| 241 | /// If the slices overlap, dest.ptr must be >= src.ptr. | 242 | /// If the slices overlap, dest.ptr must be >= src.ptr. |
| | 243 | /// This function is deprecated; use @memmove instead. |
| 242 | pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void { | 244 | pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void { |
| 243 | // TODO instead of manually doing this check for the whole array | 245 | // TODO instead of manually doing this check for the whole array |
| 244 | // and turning off runtime safety, the compiler should detect loops like | 246 | // and turning off runtime safety, the compiler should detect loops like |