Embedded Template Library 1.0
Loading...
Searching...
No Matches
reference_flat_set.h
Go to the documentation of this file.
1
2
3/******************************************************************************
4The MIT License(MIT)
5
6Embedded Template Library.
7https://github.com/ETLCPP/etl
8https://www.etlcpp.com
9
10Copyright(c) 2017 John Wellbelove
11
12Permission is hereby granted, free of charge, to any person obtaining a copy
13of this software and associated documentation files(the "Software"), to deal
14in the Software without restriction, including without limitation the rights
15to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16copies of the Software, and to permit persons to whom the Software is
17furnished to do so, subject to the following conditions :
18
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21
22THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28SOFTWARE.
29******************************************************************************/
30
31#ifndef ETL_REFERENCE_FLAT_SET_INCLUDED
32#define ETL_REFERENCE_FLAT_SET_INCLUDED
33
34#include "platform.h"
35#include "algorithm.h"
36#include "error_handler.h"
37#include "exception.h"
38#include "functional.h"
39#include "iterator.h"
40#include "nth_type.h"
41#include "pool.h"
42#include "type_traits.h"
43#include "utility.h"
44#include "vector.h"
45
47
48#include <stddef.h>
49
50namespace etl
51{
52 //***************************************************************************
55 //***************************************************************************
56 class flat_set_exception : public exception
57 {
58 public:
59
60 flat_set_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
61 : exception(reason_, file_name_, line_number_)
62 {
63 }
64 };
65
66 //***************************************************************************
69 //***************************************************************************
70 class flat_set_full : public flat_set_exception
71 {
72 public:
73
74 flat_set_full(string_type file_name_, numeric_type line_number_)
75 : flat_set_exception(ETL_ERROR_TEXT("flat_set:full", ETL_REFERENCE_FLAT_SET_FILE_ID"A"), file_name_, line_number_)
76 {
77 }
78 };
79
80 //***************************************************************************
83 //***************************************************************************
84 class flat_set_iterator : public flat_set_exception
85 {
86 public:
87
88 flat_set_iterator(string_type file_name_, numeric_type line_number_)
89 : flat_set_exception(ETL_ERROR_TEXT("flat_set:iterator", ETL_REFERENCE_FLAT_SET_FILE_ID"B"), file_name_, line_number_)
90 {
91 }
92 };
93
94 //***************************************************************************
99 //***************************************************************************
100 template <typename T, typename TKeyCompare = etl::less<T> >
102 {
103 public:
104
105 typedef T key_type;
106 typedef T value_type;
107 typedef TKeyCompare key_compare;
108 typedef value_type& reference;
109 typedef const value_type& const_reference;
110 typedef value_type* pointer;
111 typedef const value_type* const_pointer;
112 typedef size_t size_type;
113
114 protected:
115
116 typedef etl::ivector<value_type*> lookup_t;
117
118 public:
119
120 //*************************************************************************
121 class iterator : public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, value_type>
122 {
123 public:
124
125 friend class ireference_flat_set;
126 friend class const_iterator;
127
128 iterator() {}
129
130 iterator(typename lookup_t::iterator ilookup_)
131 : ilookup(ilookup_)
132 {
133 }
134
135 iterator(const iterator& other)
136 : ilookup(other.ilookup)
137 {
138 }
139
140 iterator& operator=(const iterator& other)
141 {
142 ilookup = other.ilookup;
143 return *this;
144 }
145
146 iterator& operator++()
147 {
148 ++ilookup;
149 return *this;
150 }
151
152 iterator operator++(int)
153 {
154 iterator temp(*this);
155 ++ilookup;
156 return temp;
157 }
158
159 iterator& operator--()
160 {
161 --ilookup;
162 return *this;
163 }
164
165 iterator operator--(int)
166 {
167 iterator temp(*this);
168 --ilookup;
169 return temp;
170 }
171
172 reference operator*() const
173 {
174 return *(*ilookup);
175 }
176
177 pointer operator&() const
178 {
179 return etl::addressof(*(*ilookup));
180 }
181
182 pointer operator->() const
183 {
184 return etl::addressof(*(*ilookup));
185 }
186
187 friend bool operator==(const iterator& lhs, const iterator& rhs)
188 {
189 return lhs.ilookup == rhs.ilookup;
190 }
191
192 friend bool operator!=(const iterator& lhs, const iterator& rhs)
193 {
194 return !(lhs == rhs);
195 }
196
197 private:
198
199 typename lookup_t::iterator ilookup;
200 };
201
202 //*************************************************************************
203 class const_iterator : public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, const value_type>
204 {
205 public:
206
207 friend class ireference_flat_set;
208
209 const_iterator() {}
210
211 const_iterator(typename lookup_t::const_iterator ilookup_)
212 : ilookup(ilookup_)
213 {
214 }
215
216 const_iterator(const typename ireference_flat_set::iterator& other)
217 : ilookup(other.ilookup)
218 {
219 }
220
221 const_iterator(const const_iterator& other)
222 : ilookup(other.ilookup)
223 {
224 }
225
226 const_iterator& operator=(const iterator& other)
227 {
228 ilookup = other.ilookup;
229 return *this;
230 }
231
232 const_iterator& operator=(const const_iterator& other)
233 {
234 ilookup = other.ilookup;
235 return *this;
236 }
237
238 const_iterator& operator++()
239 {
240 ++ilookup;
241 return *this;
242 }
243
244 const_iterator operator++(int)
245 {
246 const_iterator temp(*this);
247 ++ilookup;
248 return temp;
249 }
250
251 const_iterator& operator--()
252 {
253 --ilookup;
254 return *this;
255 }
256
257 const_iterator operator--(int)
258 {
259 const_iterator temp(*this);
260 --ilookup;
261 return temp;
262 }
263
264 const_reference operator*() const
265 {
266 return *(*ilookup);
267 }
268
269 const_pointer operator&() const
270 {
271 return etl::addressof(*(*ilookup));
272 }
273
274 const_pointer operator->() const
275 {
276 return etl::addressof(*(*ilookup));
277 }
278
279 friend bool operator==(const const_iterator& lhs, const const_iterator& rhs)
280 {
281 return lhs.ilookup == rhs.ilookup;
282 }
283
284 friend bool operator!=(const const_iterator& lhs, const const_iterator& rhs)
285 {
286 return !(lhs == rhs);
287 }
288
289 private:
290
291 typename lookup_t::const_iterator ilookup;
292 };
293
294 protected:
295
296 typedef typename etl::parameter_type<T>::type parameter_t;
297
298 public:
299
300 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
301 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
302 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
303
304 //*********************************************************************
307 //*********************************************************************
308 iterator begin()
309 {
310 return iterator(lookup.begin());
311 }
312
313 //*********************************************************************
316 //*********************************************************************
317 const_iterator begin() const
318 {
319 return const_iterator(lookup.begin());
320 }
321
322 //*********************************************************************
325 //*********************************************************************
326 iterator end()
327 {
328 return iterator(lookup.end());
329 }
330
331 //*********************************************************************
334 //*********************************************************************
335 const_iterator end() const
336 {
337 return const_iterator(lookup.end());
338 }
339
340 //*********************************************************************
343 //*********************************************************************
344 const_iterator cbegin() const
345 {
346 return const_iterator(lookup.cbegin());
347 }
348
349 //*********************************************************************
352 //*********************************************************************
353 const_iterator cend() const
354 {
355 return const_iterator(lookup.cend());
356 }
357
358 //*********************************************************************
362 //*********************************************************************
363 reverse_iterator rbegin()
364 {
365 return reverse_iterator(lookup.rbegin());
366 }
367
368 //*********************************************************************
373 //*********************************************************************
374 const_reverse_iterator rbegin() const
375 {
376 return const_reverse_iterator(lookup.rbegin());
377 }
378
379 //*********************************************************************
382 //*********************************************************************
383 reverse_iterator rend()
384 {
385 return reverse_iterator(lookup.rend());
386 }
387
388 //*********************************************************************
392 //*********************************************************************
393 const_reverse_iterator rend() const
394 {
395 return const_reverse_iterator(lookup.rend());
396 }
397
398 //*********************************************************************
403 //*********************************************************************
404 const_reverse_iterator crbegin() const
405 {
406 return const_reverse_iterator(lookup.crbegin());
407 }
408
409 //*********************************************************************
413 //*********************************************************************
414 const_reverse_iterator crend() const
415 {
416 return const_reverse_iterator(lookup.crend());
417 }
418
419 //*********************************************************************
427 //*********************************************************************
428 template <typename TIterator>
429 void assign(TIterator first, TIterator last)
430 {
431#if ETL_IS_DEBUG_BUILD
432 difference_type d = etl::distance(first, last);
433 ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_set_full));
434#endif
435
436 clear();
437
438 while (first != last)
439 {
440 insert(*first);
441 ++first;
442 }
443 }
444
445 //*********************************************************************
450 //*********************************************************************
451 ETL_OR_STD::pair<iterator, bool> insert(reference value)
452 {
453 iterator i_element = lower_bound(value);
454
455 return insert_at(i_element, value);
456 }
457
458 //*********************************************************************
464 //*********************************************************************
465 ETL_OR_STD::pair<iterator, bool> emplace(reference value)
466 {
467 return insert(value);
468 }
469
470 //*********************************************************************
476 //*********************************************************************
477 iterator insert(const_iterator /*position*/, reference value)
478 {
479 return insert(value).first;
480 }
481
482 //*********************************************************************
489 //*********************************************************************
490 template <class TIterator>
491 void insert(TIterator first, TIterator last)
492 {
493 while (first != last)
494 {
495 insert(*first);
496 ++first;
497 }
498 }
499
500 //*********************************************************************
504 //*********************************************************************
505 size_t erase(parameter_t key)
506 {
507 iterator i_element = find(key);
508
509 if (i_element == end())
510 {
511 return 0;
512 }
513 else
514 {
515 lookup.erase(i_element.ilookup);
516 return 1;
517 }
518 }
519
520 //*********************************************************************
521#if ETL_USING_CPP11
522 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
523 size_t erase(K&& key)
524 {
525 iterator i_element = find(etl::forward<K>(key));
526
527 if (i_element == end())
528 {
529 return 0;
530 }
531 else
532 {
533 lookup.erase(i_element.ilookup);
534 return 1;
535 }
536 }
537#endif
538
539 //*********************************************************************
542 //*********************************************************************
543 iterator erase(iterator i_element)
544 {
545 return lookup.erase(i_element.ilookup);
546 }
547
548 //*********************************************************************
551 //*********************************************************************
552 iterator erase(const_iterator i_element)
553 {
554 return lookup.erase(i_element.ilookup);
555 }
556
557 //*********************************************************************
563 //*********************************************************************
564 iterator erase(const_iterator first, const_iterator last)
565 {
566 return lookup.erase(first.ilookup, last.ilookup);
567 }
568
569 //*************************************************************************
571 //*************************************************************************
572 void clear()
573 {
574 lookup.clear();
575 }
576
577 //*********************************************************************
581 //*********************************************************************
582 iterator find(parameter_t key)
583 {
584 iterator itr = etl::lower_bound(begin(), end(), key, compare);
585
586 if (itr != end())
587 {
588 if (!key_compare()(*itr, key) && !key_compare()(key, *itr))
589 {
590 return itr;
591 }
592 else
593 {
594 return end();
595 }
596 }
597
598 return end();
599 }
600
601#if ETL_USING_CPP11
602 //*********************************************************************
603 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
604 iterator find(const K& key)
605 {
606 iterator itr = etl::lower_bound(begin(), end(), key, compare);
607
608 if (itr != end())
609 {
610 if (!key_compare()(*itr, key) && !key_compare()(key, *itr))
611 {
612 return itr;
613 }
614 else
615 {
616 return end();
617 }
618 }
619
620 return end();
621 }
622#endif
623
624 //*********************************************************************
628 //*********************************************************************
629 const_iterator find(parameter_t key) const
630 {
631 const_iterator itr = etl::lower_bound(begin(), end(), key, compare);
632
633 if (itr != end())
634 {
635 if (!key_compare()(*itr, key) && !key_compare()(key, *itr))
636 {
637 return itr;
638 }
639 else
640 {
641 return end();
642 }
643 }
644
645 return end();
646 }
647
648#if ETL_USING_CPP11
649 //*********************************************************************
650 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
651 const_iterator find(const K& key) const
652 {
653 const_iterator itr = etl::lower_bound(begin(), end(), key, compare);
654
655 if (itr != end())
656 {
657 if (!key_compare()(*itr, key) && !key_compare()(key, *itr))
658 {
659 return itr;
660 }
661 else
662 {
663 return end();
664 }
665 }
666
667 return end();
668 }
669#endif
670
671 //*********************************************************************
675 //*********************************************************************
676 size_t count(parameter_t key) const
677 {
678 return (find(key) == end()) ? 0 : 1;
679 }
680
681#if ETL_USING_CPP11
682 //*********************************************************************
683 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
684 size_t count(const K& key) const
685 {
686 return (find(key) == end()) ? 0 : 1;
687 }
688#endif
689
690 //*********************************************************************
694 //*********************************************************************
695 iterator lower_bound(parameter_t key)
696 {
697 return etl::lower_bound(begin(), end(), key, compare);
698 }
699
700#if ETL_USING_CPP11
701 //*********************************************************************
702 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
703 iterator lower_bound(const K& key)
704 {
705 return etl::lower_bound(begin(), end(), key, compare);
706 }
707#endif
708
709 //*********************************************************************
713 //*********************************************************************
714 const_iterator lower_bound(parameter_t key) const
715 {
716 return etl::lower_bound(cbegin(), cend(), key, compare);
717 }
718
719#if ETL_USING_CPP11
720 //*********************************************************************
721 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
722 const_iterator lower_bound(const K& key) const
723 {
724 return etl::lower_bound(cbegin(), cend(), key, compare);
725 }
726#endif
727
728 //*********************************************************************
732 //*********************************************************************
733 iterator upper_bound(parameter_t key)
734 {
735 return etl::upper_bound(begin(), end(), key, compare);
736 }
737
738#if ETL_USING_CPP11
739 //*********************************************************************
740 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
741 iterator upper_bound(const K& key)
742 {
743 return etl::upper_bound(begin(), end(), key, compare);
744 }
745#endif
746
747 //*********************************************************************
751 //*********************************************************************
752 const_iterator upper_bound(parameter_t key) const
753 {
754 return etl::upper_bound(cbegin(), cend(), key, compare);
755 }
756
757#if ETL_USING_CPP11
758 //*********************************************************************
759 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
760 const_iterator upper_bound(const K& key) const
761 {
762 return etl::upper_bound(cbegin(), cend(), key, compare);
763 }
764#endif
765
766 //*********************************************************************
770 //*********************************************************************
771 ETL_OR_STD::pair<iterator, iterator> equal_range(parameter_t key)
772 {
773 return etl::equal_range(begin(), end(), key, compare);
774 }
775
776#if ETL_USING_CPP11
777 //*********************************************************************
778 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
779 ETL_OR_STD::pair<iterator, iterator> equal_range(const K& key)
780 {
781 return etl::equal_range(begin(), end(), key, compare);
782 }
783#endif
784
785 //*********************************************************************
789 //*********************************************************************
790 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(parameter_t key) const
791 {
792 return etl::upper_bound(cbegin(), cend(), key, compare);
793 }
794
795#if ETL_USING_CPP11
796 //*********************************************************************
797 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
798 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(const K& key) const
799 {
800 return etl::upper_bound(cbegin(), cend(), key, compare);
801 }
802#endif
803
804 //*************************************************************************
806 //*************************************************************************
807 bool contains(parameter_t key) const
808 {
809 return find(key) != end();
810 }
811
812#if ETL_USING_CPP11
813 //*************************************************************************
814 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
815 bool contains(const K& k) const
816 {
817 return find(k) != end();
818 }
819#endif
820
821 //*************************************************************************
824 //*************************************************************************
825 size_type size() const
826 {
827 return lookup.size();
828 }
829
830 //*************************************************************************
833 //*************************************************************************
834 bool empty() const
835 {
836 return lookup.empty();
837 }
838
839 //*************************************************************************
842 //*************************************************************************
843 bool full() const
844 {
845 return lookup.full();
846 }
847
848 //*************************************************************************
851 //*************************************************************************
852 size_type capacity() const
853 {
854 return lookup.capacity();
855 }
856
857 //*************************************************************************
860 //*************************************************************************
861 size_type max_size() const
862 {
863 return lookup.max_size();
864 }
865
866 //*************************************************************************
869 //*************************************************************************
870 size_t available() const
871 {
872 return lookup.available();
873 }
874
875 protected:
876
877 //*********************************************************************
879 //*********************************************************************
880 ireference_flat_set(lookup_t& lookup_)
881 : lookup(lookup_)
882 {
883 }
884
885 //*********************************************************************
889 //*********************************************************************
890 ETL_OR_STD::pair<iterator, bool> insert_at(iterator i_element, reference value)
891 {
892 ETL_OR_STD::pair<iterator, bool> result(end(), false);
893
894 if (i_element == end())
895 {
896 // At the end.
897 ETL_ASSERT(!lookup.full(), ETL_ERROR(flat_set_full));
898
899 lookup.push_back(&value);
900 result.first = --end();
901 result.second = true;
902 }
903 else
904 {
905 // Not at the end.
906 result.first = i_element;
907
908 // Existing element?
909 if (compare(value, *i_element) || compare(*i_element, value))
910 {
911 // A new one.
912 ETL_ASSERT(!lookup.full(), ETL_ERROR(flat_set_full));
913 lookup.insert(i_element.ilookup, &value);
914 result.second = true;
915 }
916 }
917
918 return result;
919 }
920
921 private:
922
923 // Disable copy construction.
925 ireference_flat_set& operator=(const ireference_flat_set&);
926
927 lookup_t& lookup;
928
929 TKeyCompare compare;
930
931 //*************************************************************************
933 //*************************************************************************
934#if defined(ETL_POLYMORPHIC_REFERENCE_FLAT_SET) || defined(ETL_POLYMORPHIC_CONTAINERS)
935
936 public:
937
938 virtual ~ireference_flat_set() {}
939#else
940
941 protected:
942
944#endif
945 };
946
947 //***************************************************************************
950 //***************************************************************************
951 template <typename TKey, const size_t MAX_SIZE_, typename TKeyCompare = etl::less<TKey> >
952 class reference_flat_set : public ireference_flat_set<TKey, TKeyCompare>
953 {
954 public:
955
956 static ETL_CONSTANT size_t MAX_SIZE = MAX_SIZE_;
957
958 using typename ireference_flat_set<TKey, TKeyCompare>::value_type;
959
960 //*************************************************************************
962 //*************************************************************************
964 : ireference_flat_set<TKey, TKeyCompare>(lookup)
965 {
966 }
967
968 //*************************************************************************
970 //*************************************************************************
972 : ireference_flat_set<TKey, TKeyCompare>(lookup)
973 {
975 }
976
977 //*************************************************************************
982 //*************************************************************************
983 template <typename TIterator>
984 reference_flat_set(TIterator first, TIterator last)
985 : ireference_flat_set<TKey, TKeyCompare>(lookup)
986 {
988 }
989
990 //*************************************************************************
992 //*************************************************************************
997
998 private:
999
1000 // The vector that stores pointers to the nodes.
1002 };
1003
1004 template <typename TKey, const size_t MAX_SIZE_, typename TCompare>
1005 ETL_CONSTANT size_t reference_flat_set<TKey, MAX_SIZE_, TCompare>::MAX_SIZE;
1006
1007 //*************************************************************************
1009 //*************************************************************************
1010#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
1011 template <typename... T>
1012 reference_flat_set(T...) -> reference_flat_set<etl::nth_type_t<0, T...>, sizeof...(T)>;
1013#endif
1014
1015 //*************************************************************************
1017 //*************************************************************************
1018#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
1019 template <typename TKey, typename TKeyCompare = etl::less<TKey>, typename... T>
1020 constexpr auto make_reference_flat_set(T&&... keys) -> etl::reference_flat_set<TKey, sizeof...(T), TKeyCompare>
1021 {
1022 return {etl::forward<T>(keys)...};
1023 }
1024#endif
1025
1026 //***************************************************************************
1032 //***************************************************************************
1033 template <typename T, typename TKeyCompare>
1035 {
1036 return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
1037 }
1038
1039 //***************************************************************************
1045 //***************************************************************************
1046 template <typename T, typename TKeyCompare>
1048 {
1049 return !(lhs == rhs);
1050 }
1051} // namespace etl
1052
1053#endif
Definition reference_flat_set.h:71
Definition reference_flat_set.h:122
Definition reference_flat_set.h:102
const_iterator lower_bound(parameter_t key) const
Definition reference_flat_set.h:714
~ireference_flat_set()
Destructor.
Definition reference_flat_set.h:943
size_type capacity() const
Definition reference_flat_set.h:852
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, reference value)
Definition reference_flat_set.h:890
size_t available() const
Definition reference_flat_set.h:870
ETL_OR_STD::pair< iterator, bool > insert(reference value)
Definition reference_flat_set.h:451
const_iterator begin() const
Definition reference_flat_set.h:317
iterator upper_bound(parameter_t key)
Definition reference_flat_set.h:733
const_iterator find(parameter_t key) const
Definition reference_flat_set.h:629
iterator erase(iterator i_element)
Definition reference_flat_set.h:543
void assign(TIterator first, TIterator last)
Definition reference_flat_set.h:429
iterator erase(const_iterator first, const_iterator last)
Definition reference_flat_set.h:564
const_reverse_iterator rend() const
Definition reference_flat_set.h:393
const_reverse_iterator crbegin() const
Definition reference_flat_set.h:404
const_iterator end() const
Definition reference_flat_set.h:335
iterator begin()
Definition reference_flat_set.h:308
size_t erase(parameter_t key)
Definition reference_flat_set.h:505
bool contains(parameter_t key) const
Check if the set contains the key.
Definition reference_flat_set.h:807
iterator insert(const_iterator, reference value)
Definition reference_flat_set.h:477
iterator end()
Definition reference_flat_set.h:326
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(parameter_t key) const
Definition reference_flat_set.h:790
ETL_OR_STD::pair< iterator, iterator > equal_range(parameter_t key)
Definition reference_flat_set.h:771
const_iterator upper_bound(parameter_t key) const
Definition reference_flat_set.h:752
const_iterator cend() const
Definition reference_flat_set.h:353
const_iterator cbegin() const
Definition reference_flat_set.h:344
ETL_OR_STD::pair< iterator, bool > emplace(reference value)
Definition reference_flat_set.h:465
iterator find(parameter_t key)
Definition reference_flat_set.h:582
const_reverse_iterator rbegin() const
Definition reference_flat_set.h:374
size_type max_size() const
Definition reference_flat_set.h:861
const_reverse_iterator crend() const
Definition reference_flat_set.h:414
bool empty() const
Definition reference_flat_set.h:834
size_type size() const
Definition reference_flat_set.h:825
reverse_iterator rbegin()
Definition reference_flat_set.h:363
ireference_flat_set(lookup_t &lookup_)
Constructor.
Definition reference_flat_set.h:880
size_t count(parameter_t key) const
Definition reference_flat_set.h:676
void insert(TIterator first, TIterator last)
Definition reference_flat_set.h:491
bool full() const
Definition reference_flat_set.h:843
void clear()
Clears the reference_flat_set.
Definition reference_flat_set.h:572
iterator erase(const_iterator i_element)
Definition reference_flat_set.h:552
iterator lower_bound(parameter_t key)
Definition reference_flat_set.h:695
reverse_iterator rend()
Definition reference_flat_set.h:383
Definition vector.h:65
Definition reference_flat_set.h:953
reference_flat_set(TIterator first, TIterator last)
Definition reference_flat_set.h:984
reference_flat_set(const reference_flat_set &other)
Copy constructor.
Definition reference_flat_set.h:971
reference_flat_set()
Constructor.
Definition reference_flat_set.h:963
~reference_flat_set()
Destructor.
Definition reference_flat_set.h:993
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81
ETL_CONSTEXPR17 etl::enable_if<!etl::is_same< T, etl::nullptr_t >::value, T >::type * addressof(T &t)
Definition addressof.h:52
Definition vector.h:1830
Definition absolute.h:40
ETL_CONSTEXPR14 bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1078
ETL_CONSTEXPR14 bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1090
Definition compare.h:51
iterator
Definition iterator.h:482
etl::conditional< etl::is_fundamental< T >::value||etl::is_pointer< T >::value, T, constT & >::type type
By default fundamental and pointer types are passed by value.
Definition parameter_type.h:46
ETL_CONSTEXPR14 bool operator==(const etl::to_arithmetic_result< T > &lhs, const etl::to_arithmetic_result< T > &rhs)
Equality test for etl::to_arithmetic_result.
Definition to_arithmetic.h:903
ETL_CONSTEXPR14 bool operator!=(const etl::to_arithmetic_result< T > &lhs, const etl::to_arithmetic_result< T > &rhs)
Inequality test for etl::to_arithmetic_result.
Definition to_arithmetic.h:937