ptr: Add mut_offset, to be able to calculate an offset on mutable pointers.
This commit is contained in:
parent
020d8f12a0
commit
9aa6e5750e
1 changed files with 10 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue