ptr: Add mut_offset, to be able to calculate an offset on mutable pointers.
This commit is contained in:
parent
020d8f12a0
commit
9aa6e5750e
@ -34,6 +34,16 @@ fn offset<T>(ptr: *T, count: uint) -> *T {
|
||||
ret rusti::ptr_offset(ptr, count);
|
||||
}
|
||||
|
||||
/*
|
||||
Function: mut_offset
|
||||
|
||||
Calculate the offset from a mutable pointer
|
||||
*/
|
||||
fn mut_offset<T>(ptr: *mutable T, count: uint) -> *mutable T {
|
||||
ret rusti::ptr_offset(ptr as *T, count) as *mutable T;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Function: null
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user