template<typename T, size_t INLINE_THRESHOLD = 8>
class kmp_vector< T, INLINE_THRESHOLD >
kmp_vector is a vector class for managing small vectors.
INLINE_THRESHOLD: Number of elements in the inline array. If exceeded, the vector will grow dynamically.
Definition at line 148 of file kmp_adt.h.
template<typename T, size_t INLINE_THRESHOLD = 8>
template<typename Fn = default_eq>
| bool kmp_vector< T, INLINE_THRESHOLD >::contains |
( |
const T & | value, |
|
|
const Fn & | comp = Fn{} ) const |
|
inline |
Check if the vector contains the given value.
If a comparator is provided, it will be used to compare the values. Otherwise, the equality operator will be used.
Definition at line 271 of file kmp_adt.h.
template<typename T, size_t INLINE_THRESHOLD = 8>
template<typename Fn = default_eq>
| bool kmp_vector< T, INLINE_THRESHOLD >::is_set_equal |
( |
const kmp_vector< T, INLINE_THRESHOLD > & | other, |
|
|
const Fn & | comp = Fn{} ) const |
|
inline |
Check if the two vectors are equal with set semantics.
Current implementation is naive O(n^2) and not optimized for performance. Handles duplicates correctly.
Definition at line 287 of file kmp_adt.h.