Unique items constraint ( uniqueItems ).
More...
#include <constraints.hpp>
Public Member Functions | |
| template<anch::val::Collection V> requires std::equality_comparable<std::ranges::range_value_t<V>> | |
| bool | check (const V &items, std::string &message) const |
Unique items constraint ( uniqueItems ).
Items have to be comparable with == . When they are also totally ordered, duplicates are found by sorting (O(n.log(n)) ), otherwise every pair of items is compared (O(n²) ).
| bool anch::val::UniqueItems::check | ( | const V & | items, |
| std::string & | message ) const |
Check value
| V | the value type |
| items | the value |
| message | the error message (set when value is invalid) |
true when value is valid