17 constexpr
bool operator()(
const T &lhs,
const T &rhs)
const 24 template<
typename KeyT,
typename EqT = ListSetEqualTo<KeyT>>
28 using List = std::vector<KeyT>;
30 using size_type = size_t;
31 using value_type = KeyT;
32 using reference = KeyT&;
33 using const_reference =
const KeyT&;
34 using iterator =
typename List::iterator;
35 using const_iterator =
typename List::const_iterator;
37 iterator begin() {
return _list.begin(); }
38 iterator end() {
return _list.end(); }
39 const_iterator begin()
const {
return _list.begin(); }
40 const_iterator end()
const {
return _list.end(); }
42 size_t size()
const {
return _list.size(); }
43 bool empty()
const {
return _list.empty(); }
45 int count(
const KeyT& key)
const 47 for (
auto&& k : *
this) {
55 bool insert(
const KeyT& key)
57 for (
auto&& k : *
this) {
69 _list.shrink_to_fit();
72 void clear() { _list.clear(); }
Linear lookup set for quick lookups among few values.
Definition: list_set.hpp:25
like std::equal_to but no need to #include <functional>
Definition: list_set.hpp:15
void shrink_to_fit()
Frees unnecessary memory.
Definition: list_set.hpp:67
Definition: coroutine.hpp:18