rust/src/test/run-pass/box-unbox.rs

11 lines
201 B
Rust
Raw Normal View History

2010-06-23 21:03:09 -07:00
type box[T] = tup(@T);
2011-01-27 13:49:27 -08:00
fn unbox[T](&box[T] b) -> T { ret *b._0; }
2010-06-23 21:03:09 -07:00
fn main() {
let int foo = 17;
let box[int] bfoo = tup(@foo);
2010-06-23 21:03:09 -07:00
log "see what's in our box";
check (unbox[int](bfoo) == foo);
}