18template <
typename Key,
typename Allocator>
class set;
24template <
typename Key, size N>
47 for (
auto it =
begin(); it !=
end(); ++it) {
56 for (
auto it =
begin(); it !=
end(); ++it) {
65 if (
data.size() < N) {
77 if (
data.size() < N) {
88 template<
typename... Args>
90 if (
data.size() < N) {
93 auto it =
find(temp_key);
120 bool allow_rollover =
false)
const {
127 }
else if (allow_rollover && !
empty()) {
128 *next_key = *
begin();
136 bool allow_rollover =
false)
const {
143 }
else if (allow_rollover && !
empty()) {
152 constexpr fl::size
size()
const {
return data.size(); }
223 if (
this != &other) {
231 if (
this != &other) {
246 for (
auto it =
begin(); it !=
end(); ++it) {
255 for (
auto it =
begin(); it !=
end(); ++it) {
283 template<
typename... Args>
287 auto it =
find(temp_key);
313 constexpr fl::size
size()
const {
return data.size(); }
367template <
typename Key,
typename Allocator = fl::allocator_slab<Key>>
class set {
400 for (
const auto& elem :
init) {
408 for (
const auto& elem :
init) {
434 return mTree.insert(key);
441 template<
typename... Args>
451 return mTree.erase(key);
460 return mTree.count(key);
464 return mTree.find(key);
468 return mTree.contains(key);
476 return mTree.equal_range(key);
480 return mTree.lower_bound(key);
484 return mTree.upper_bound(key);
489 if (
size() != other.
size())
return false;
495 return !(*
this == other);
505 return *
this < other || *
this == other;
510 return other < *
this;
515 return other <= *
this;
521template <
typename T, fl::size N>
const Key * const_iterator
typename TreeType::const_reverse_iterator const_reverse_iterator
typename TreeType::const_iterator const_iterator
VectorSet(VectorSet &&other) FL_NOEXCEPT
const_iterator begin() const
bool has(const Key &key) const
VectorType::iterator iterator
bool insert(const Key &key)
const Key & front() const
bool erase(const Key &key)
constexpr fl::size capacity() const
bool operator==(const VectorSet &other) const
Equality comparison.
VectorSet & operator=(VectorSet &&other) FL_NOEXCEPT
VectorType::reverse_iterator reverse_iterator
fl::vector< Key > VectorType
bool operator>=(const VectorSet &other) const
Greater-than-or-equal comparison.
bool operator<=(const VectorSet &other) const
Less-than-or-equal comparison.
bool operator<(const VectorSet &other) const
Lexicographic comparison.
iterator find(const Key &key)
const_iterator find(const Key &key) const
bool emplace(Args &&... args)
constexpr fl::size size() const
reverse_iterator rbegin()
constexpr bool empty() const
constexpr VectorSet() FL_NOEXCEPT=default
bool operator!=(const VectorSet &other) const
Inequality comparison.
const_iterator end() const
VectorType::const_iterator const_iterator
bool operator>(const VectorSet &other) const
Greater-than comparison.
VectorSet & operator=(const VectorSet &other) FL_NOEXCEPT
constexpr fl::size capacity() const
bool operator>=(const VectorSetFixed &other) const
Greater-than-or-equal comparison.
VectorType::iterator iterator
bool operator!=(const VectorSetFixed &other) const
Inequality comparison.
const_iterator find(const Key &key) const
bool erase(const Key &key)
bool operator==(const VectorSetFixed &other) const
Equality comparison.
constexpr fl::size size() const
constexpr bool empty() const
bool operator>(const VectorSetFixed &other) const
Greater-than comparison.
VectorType::const_iterator const_iterator
bool next(const Key &key, Key *next_key, bool allow_rollover=false) const
bool operator<(const VectorSetFixed &other) const
Lexicographic comparison.
constexpr VectorSetFixed() FL_NOEXCEPT=default
FixedVector< Key, N > VectorType
const_iterator begin() const
bool prev(const Key &key, Key *prev_key, bool allow_rollover=false) const
bool emplace(Args &&... args)
const_iterator end() const
bool insert(const Key &key)
const Key & front() const
bool has(const Key &key) const
iterator find(const Key &key)
bool operator<=(const VectorSetFixed &other) const
Less-than-or-equal comparison.
bool operator>=(const set &other) const
Greater-than-or-equal comparison.
set & operator=(set &&other) FL_NOEXCEPT=default
const_reverse_iterator rbegin() const
size_type max_size() const
const_reverse_iterator rend() const
ptrdiff_t difference_type
bool operator!=(const set &other) const
Inequality comparison.
set & operator=(fl::initializer_list< Key > init) FL_NOEXCEPT
set(fl::initializer_list< Key > init)
const_reverse_iterator reverse_iterator
fl::pair< const_iterator, bool > insert(Key &&key)
const_iterator begin() const
bool has(const Key &key) const
fl::pair< const_iterator, bool > insert(const Key &key)
const Key & const_reference
bool contains(const Key &key) const
typename TreeType::const_reverse_iterator const_reverse_iterator
const_iterator cbegin() const
set & operator=(const set &other) FL_NOEXCEPT=default
fl::pair< const_iterator, bool > emplace(Args &&... args)
typename TreeType::const_iterator const_iterator
fl::pair< const_iterator, const_iterator > equal_range(const Key &key) const
const_iterator find(const Key &key) const
size_type count(const Key &key) const
const_iterator lower_bound(const Key &key) const
bool operator<(const set &other) const
Lexicographic comparison.
const_iterator erase(const_iterator pos)
bool operator<=(const set &other) const
Less-than-or-equal comparison.
set() FL_NOEXCEPT=default
const Key * const_pointer
const_iterator cend() const
const_iterator end() const
set(const set &other) FL_NOEXCEPT=default
bool operator>(const set &other) const
Greater-than comparison.
const_iterator upper_bound(const Key &key) const
fl::SetRedBlackTree< Key, fl::less< Key >, Allocator > TreeType
bool operator==(const set &other) const
Equality comparison.
set(set &&other) FL_NOEXCEPT=default
size_type erase(const Key &key)
allocator_type get_allocator() const
const Key * const_iterator
constexpr T && forward(typename remove_reference< T >::type &t) FL_NOEXCEPT
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
void init(Context &ctx, int w, int h)
fl::set< T, fl::allocator_inlined_slab< T, N > > set_inlined
VectorSetFixed< Key, N > FixedSet
bool lexicographical_compare(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2) FL_NOEXCEPT
bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2) FL_NOEXCEPT
Base definition for an LED controller.
Binary function object that returns whether the first argument is less than the second.