diff options
| author | bors <bors@rust-lang.org> | 2013-05-17 19:58:24 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-17 19:58:24 -0700 |
| commit | 799d9fa32b0f7c0598e5a0da477b7a817cfc203f (patch) | |
| tree | f7a77f9decf24e328658e23efc4051b629d39113 /src/rustllvm/RustWrapper.cpp | |
| parent | d68c0279eadc8544a1e3c1d9077185500a36ae66 (diff) | |
| parent | 3122d8027bfb38b76a916ef0e7be850da62f6e0b (diff) | |
| download | rust-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
