rustycpp 0.1.6

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
12
13
//! Amalgamation of random funcions
use core::hash::Hash;
use std::collections::HashSet;

/// All elements of the collection are unique?
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))
}