> Also, why can't I use < to compare Option<T> even if Option<T> > implements Ord for T: Ord?
I actually implemented something like this back in December, that enabled you to use + on any two options as long as their types also implemented +. But... I forgot to send it upstream. :) I'll revive it later today, and do the same for < and friends. On Tue, Mar 5, 2013 at 1:23 PM, Sanghyeon Seo <[email protected]> wrote: > core::iter includes min and max, so I decided to implement minmax > which does 1.5 comparisons per element instead of 2 comparisons. > > Here is the result: > https://gist.github.com/sanxiyn/5092643 > > It seems to work, but I couldn't figure out how to put this in core::iter, > using BaseIter<T> instead of &[T]. Any idea? > > Also, why can't I use < to compare Option<T> even if Option<T> > implements Ord for T: Ord? > > Also, is there a better way to do this, other than using a state machine? > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
