2 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
4 pub struct Cloned<I>(I);
6 impl<'a, I, T: 'a> Iterator for Cloned<I>
8 I: Iterator<Item = &'a T>,
13 fn next(&mut self) -> Option<T> {
17 default fn count(self) -> usize where Self: Sized {
18 self.fold(0, |cnt, _| cnt + 1)
22 impl<'a, I, T: 'a> Iterator for Cloned<I>
24 I: Iterator<Item = &'a T>,
27 fn count(self) -> usize {
34 Cloned(a.iter()).count();