about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-17 19:58:24 -0700
committerbors <bors@rust-lang.org>2013-05-17 19:58:24 -0700
commit799d9fa32b0f7c0598e5a0da477b7a817cfc203f (patch)
treef7a77f9decf24e328658e23efc4051b629d39113 /src/rustllvm/RustWrapper.cpp
parentd68c0279eadc8544a1e3c1d9077185500a36ae66 (diff)
parent3122d8027bfb38b76a916ef0e7be850da62f6e0b (diff)
downloadrust-799d9fa32b0f7c0598e5a0da477b7a817cfc203f.tar.gz
rust-799d9fa32b0f7c0598e5a0da477b7a817cfc203f.zip
auto merge of #6560 : gifnksm/rust/iterator-utils, r=thestinger
This pull request adds following methods and traits.
```rust
pub trait IteratorUtil {
(snip)
    fn filter_map<'r,  B>(self, f: &'r fn(A) -> Option<B>) -> FilterMapIterator<'r, A, B, Self>;
(snip)
    fn to_vec(self) -> ~[A];
    fn nth(&mut self, n: uint) -> A;
    fn first(&mut self) -> A;
    fn last(&mut self) -> A;
    fn fold<B>(&mut self, start: B, f: &fn(B, A) -> B) -> B;
    fn count(&mut self) -> uint;
    fn all(&mut self, f: &fn(&A) -> bool) -> bool;
    fn any(&mut self, f: &fn(&A) -> bool) -> bool;
}

pub trait AdditiveIterator<A> {
    fn sum(&mut self) -> A;
}

pub trait MultiplicativeIterator<A> {
    fn product(&mut self) -> A;
}

pub trait OrdIterator<A> {
    fn max(&mut self) -> Option<A>;
    fn min(&mut self) -> Option<A>;
}
```
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions