std: deprecate std.mem.copy{Forwards,Backwards}
This commit is contained in:
@@ -232,6 +232,7 @@ test "Allocator alloc and remap with zero-bit type" {
|
||||
/// Copy all of source into dest at position 0.
|
||||
/// dest.len must be >= source.len.
|
||||
/// If the slices overlap, dest.ptr must be <= src.ptr.
|
||||
/// This function is deprecated; use @memmove instead.
|
||||
pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void {
|
||||
for (dest[0..source.len], source) |*d, s| d.* = s;
|
||||
}
|
||||
@@ -239,6 +240,7 @@ pub fn copyForwards(comptime T: type, dest: []T, source: []const T) void {
|
||||
/// Copy all of source into dest at position 0.
|
||||
/// dest.len must be >= source.len.
|
||||
/// If the slices overlap, dest.ptr must be >= src.ptr.
|
||||
/// This function is deprecated; use @memmove instead.
|
||||
pub fn copyBackwards(comptime T: type, dest: []T, source: []const T) void {
|
||||
// TODO instead of manually doing this check for the whole array
|
||||
// and turning off runtime safety, the compiler should detect loops like
|
||||
|
||||
Reference in New Issue
Block a user