rcpp 0.1.3

An attempt to implement the C++20 standard. This is mostly to have fun & learn rust
1
2
3
4
5
6
7
8
9
10
11
use core::hash::Hash;
use std::collections::HashSet;

pub fn all_unique_elements<T>(iter: T) -> bool
where
    T: IntoIterator,
    T::Item: Eq + Hash,
{
    let mut uniq = HashSet::new();
    iter.into_iter().all(move |x| uniq.insert(x))
}