2012-09-05 17:36:11 -05:00
|
|
|
use iter::BaseIter;
|
2012-06-14 19:55:11 -05:00
|
|
|
|
2012-09-05 17:36:11 -05:00
|
|
|
trait FlatMapToVec<A> {
|
2012-09-07 16:52:28 -05:00
|
|
|
fn flat_map_to_vec<B:Copy, IB:BaseIter<B>>(op: fn(A) -> IB) -> ~[B];
|
2012-09-05 17:36:11 -05:00
|
|
|
}
|
|
|
|
|
2012-09-07 16:52:28 -05:00
|
|
|
impl<A:Copy> BaseIter<A>: FlatMapToVec<A> {
|
|
|
|
fn flat_map_to_vec<B:Copy, IB:BaseIter<B>>(op: fn(A) -> IB) -> ~[B] {
|
2012-09-05 17:36:11 -05:00
|
|
|
iter::flat_map_to_vec(self, op)
|
2012-06-14 19:55:11 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|