2012-06-29 16:26:56 -07:00
|
|
|
fn double<T: copy>(a: T) -> ~[T] { ret ~[a] + ~[a]; }
|
2011-07-08 11:29:29 -07:00
|
|
|
|
2012-06-29 16:26:56 -07:00
|
|
|
fn double_int(a: int) -> ~[int] { ret ~[a] + ~[a]; }
|
2011-07-08 11:29:29 -07:00
|
|
|
|
|
|
|
fn main() {
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut d = double(1);
|
2011-08-19 15:16:48 -07:00
|
|
|
assert (d[0] == 1);
|
|
|
|
assert (d[1] == 1);
|
2011-07-08 11:29:29 -07:00
|
|
|
|
|
|
|
d = double_int(1);
|
2011-08-19 15:16:48 -07:00
|
|
|
assert (d[0] == 1);
|
|
|
|
assert (d[1] == 1);
|
2011-07-08 11:29:29 -07:00
|
|
|
}
|
|
|
|
|