2011-12-13 18:25:51 -06:00
|
|
|
export ptr_eq;
|
|
|
|
|
2012-01-16 20:34:03 -06:00
|
|
|
#[doc(
|
|
|
|
brief = "Determine if two shared boxes point to the same object"
|
|
|
|
)]
|
2011-12-16 10:38:49 -06:00
|
|
|
pure fn ptr_eq<T>(a: @T, b: @T) -> bool {
|
2011-12-13 18:25:51 -06:00
|
|
|
// FIXME: ptr::addr_of
|
|
|
|
unsafe {
|
|
|
|
let a_ptr: uint = unsafe::reinterpret_cast(a);
|
|
|
|
let b_ptr: uint = unsafe::reinterpret_cast(b);
|
|
|
|
ret a_ptr == b_ptr;
|
|
|
|
}
|
|
|
|
}
|