Re: [rust-dev] RFC: Removing *T

2013-07-29 Thread Thiez
This would make for some interesting/confusing calling conventions. It would also mean T and mut T would no longer share a representation; int would simply be int, but mut int would still have to be a pointer. Borrowing mut T to T would be a dereference if T is pointer size or smaller? The only

Re: [rust-dev] Can Rust allow a bitwise equality test?

2013-07-19 Thread Thiez
I think something along these lines should do: fn bitwise_compareT(a: T, b: T) - bool { use std::{ptr,sys,cast,uint}; let size = sys::size_of::T(); unsafe { let a: u8 = cast::transmute(a); let b: u8 = cast::transmute(b); for uint::range(0,size) |n| { if *ptr::offset(a,n)