Embedded Template Library 1.0
Loading...
Searching...
No Matches
reference_flat_multimap.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_MULTIMAP_INCLUDED
32#define ETL_REFERENCE_FLAT_MULTIMAP_INCLUDED
33
34#include "platform.h"
35#include "debug_count.h"
36#include "error_handler.h"
37#include "exception.h"
38#include "iterator.h"
39#include "nth_type.h"
40#include "type_traits.h"
41#include "vector.h"
42
44
45#include <stddef.h>
46
47namespace etl
48{
49 //***************************************************************************
52 //***************************************************************************
53 class flat_multimap_exception : public exception
54 {
55 public:
56
57 flat_multimap_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
58 : exception(reason_, file_name_, line_number_)
59 {
60 }
61 };
62
63 //***************************************************************************
66 //***************************************************************************
67 class flat_multimap_full : public flat_multimap_exception
68 {
69 public:
70
71 flat_multimap_full(string_type file_name_, numeric_type line_number_)
72 : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:full", ETL_REFERENCE_FLAT_MULTIMAP_FILE_ID"A"), file_name_, line_number_)
73 {
74 }
75 };
76
77 //***************************************************************************
82 //***************************************************************************
83 template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey> >
85 {
86 public:
87
88 typedef ETL_OR_STD::pair<const TKey, TMapped> value_type;
89
90 protected:
91
92 typedef etl::ivector<value_type*> lookup_t;
93
94 public:
95
96 typedef TKey key_type;
97 typedef TMapped mapped_type;
98 typedef TKeyCompare key_compare;
99 typedef value_type& reference;
100 typedef const value_type& const_reference;
101 typedef value_type* pointer;
102 typedef const value_type* const_pointer;
103 typedef size_t size_type;
104
105 //*************************************************************************
106 class iterator : public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, value_type>
107 {
108 public:
109
110 friend class ireference_flat_multimap;
111 friend class const_iterator;
112
113 iterator() {}
114
115 iterator(typename lookup_t::iterator ilookup_)
116 : ilookup(ilookup_)
117 {
118 }
119
120 iterator(const iterator& other)
121 : ilookup(other.ilookup)
122 {
123 }
124
125 iterator& operator=(const iterator& other)
126 {
127 ilookup = other.ilookup;
128 return *this;
129 }
130
131 iterator& operator++()
132 {
133 ++ilookup;
134 return *this;
135 }
136
137 iterator operator++(int)
138 {
139 iterator temp(*this);
140 ++ilookup;
141 return temp;
142 }
143
144 iterator& operator--()
145 {
146 --ilookup;
147 return *this;
148 }
149
150 iterator operator--(int)
151 {
152 iterator temp(*this);
153 --ilookup;
154 return temp;
155 }
156
157 reference operator*() const
158 {
159 return *(*ilookup);
160 }
161
162 pointer operator&() const
163 {
164 return etl::addressof(*(*ilookup));
165 }
166
167 pointer operator->() const
168 {
169 return etl::addressof(*(*ilookup));
170 }
171
172 friend bool operator==(const iterator& lhs, const iterator& rhs)
173 {
174 return lhs.ilookup == rhs.ilookup;
175 }
176
177 friend bool operator!=(const iterator& lhs, const iterator& rhs)
178 {
179 return !(lhs == rhs);
180 }
181
182 private:
183
184 typename lookup_t::iterator ilookup;
185 };
186
187 //*************************************************************************
188 class const_iterator : public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, const value_type>
189 {
190 public:
191
192 friend class ireference_flat_multimap;
193
194 const_iterator() {}
195
196 const_iterator(typename lookup_t::const_iterator ilookup_)
197 : ilookup(ilookup_)
198 {
199 }
200
201 const_iterator(const typename ireference_flat_multimap::iterator& other)
202 : ilookup(other.ilookup)
203 {
204 }
205
206 const_iterator(const const_iterator& other)
207 : ilookup(other.ilookup)
208 {
209 }
210
211 const_iterator& operator=(const iterator& other)
212 {
213 ilookup = other.ilookup;
214 return *this;
215 }
216
217 const_iterator& operator=(const const_iterator& other)
218 {
219 ilookup = other.ilookup;
220 return *this;
221 }
222
223 const_iterator& operator++()
224 {
225 ++ilookup;
226 return *this;
227 }
228
229 const_iterator operator++(int)
230 {
231 const_iterator temp(*this);
232 ++ilookup;
233 return temp;
234 }
235
236 const_iterator& operator--()
237 {
238 --ilookup;
239 return *this;
240 }
241
242 const_iterator operator--(int)
243 {
244 const_iterator temp(*this);
245 --ilookup;
246 return temp;
247 }
248
249 const_reference operator*() const
250 {
251 return *(*ilookup);
252 }
253
254 const_pointer operator&() const
255 {
256 return etl::addressof(*(*ilookup));
257 }
258
259 const_pointer operator->() const
260 {
261 return etl::addressof(*(*ilookup));
262 }
263
264 friend bool operator==(const const_iterator& lhs, const const_iterator& rhs)
265 {
266 return lhs.ilookup == rhs.ilookup;
267 }
268
269 friend bool operator!=(const const_iterator& lhs, const const_iterator& rhs)
270 {
271 return !(lhs == rhs);
272 }
273
274 private:
275
276 typename lookup_t::const_iterator ilookup;
277 };
278
279 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
280 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
281 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
282
283 protected:
284
285 typedef const TKey& key_parameter_t;
286
287 private:
288
289 //*********************************************************************
291 //*********************************************************************
292 class Compare
293 {
294 public:
295
296 bool operator()(const value_type& element, key_type key) const
297 {
298 return comp(element.first, key);
299 }
300
301 bool operator()(key_type key, const value_type& element) const
302 {
303 return comp(key, element.first);
304 }
305
306#if ETL_USING_CPP11
307 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
308 bool operator()(const value_type& element, const K& key) const
309 {
310 return comp(element.first, key);
311 }
312
313 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
314 bool operator()(const K& key, const value_type& element) const
315 {
316 return comp(key, element.first);
317 }
318#endif
319
320 key_compare comp;
321 };
322
323 public:
324
325 //*********************************************************************
328 //*********************************************************************
329 iterator begin()
330 {
331 return iterator(lookup.begin());
332 }
333
334 //*********************************************************************
338 //*********************************************************************
339 const_iterator begin() const
340 {
341 return const_iterator(lookup.begin());
342 }
343
344 //*********************************************************************
347 //*********************************************************************
348 iterator end()
349 {
350 return iterator(lookup.end());
351 }
352
353 //*********************************************************************
356 //*********************************************************************
357 const_iterator end() const
358 {
359 return const_iterator(lookup.end());
360 }
361
362 //*********************************************************************
366 //*********************************************************************
367 const_iterator cbegin() const
368 {
369 return const_iterator(lookup.cbegin());
370 }
371
372 //*********************************************************************
375 //*********************************************************************
376 const_iterator cend() const
377 {
378 return const_iterator(lookup.cend());
379 }
380
381 //*********************************************************************
385 //*********************************************************************
386 reverse_iterator rbegin()
387 {
388 return reverse_iterator(lookup.rbegin());
389 }
390
391 //*********************************************************************
396 //*********************************************************************
397 const_reverse_iterator rbegin() const
398 {
399 return const_reverse_iterator(lookup.rbegin());
400 }
401
402 //*********************************************************************
406 //*********************************************************************
407 reverse_iterator rend()
408 {
409 return reverse_iterator(lookup.rend());
410 }
411
412 //*********************************************************************
417 //*********************************************************************
418 const_reverse_iterator rend() const
419 {
420 return const_reverse_iterator(lookup.rend());
421 }
422
423 //*********************************************************************
428 //*********************************************************************
429 const_reverse_iterator crbegin() const
430 {
431 return const_reverse_iterator(lookup.crbegin());
432 }
433
434 //*********************************************************************
439 //*********************************************************************
440 const_reverse_iterator crend() const
441 {
442 return const_reverse_iterator(lookup.crend());
443 }
444
445 //*********************************************************************
453 //*********************************************************************
454 template <typename TIterator>
455 void assign(TIterator first, TIterator last)
456 {
457#if ETL_IS_DEBUG_BUILD
458 difference_type d = etl::distance(first, last);
459 ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multimap_full));
460#endif
461
462 clear();
463
464 while (first != last)
465 {
466 insert(*first);
467 ++first;
468 }
469 }
470
471 //*********************************************************************
476 //*********************************************************************
477 ETL_OR_STD::pair<iterator, bool> insert(value_type& value)
478 {
479 ETL_ASSERT(!lookup.full(), ETL_ERROR(flat_multimap_full));
480
481 ETL_OR_STD::pair<iterator, bool> result(end(), false);
482
483 iterator i_element = upper_bound(value.first);
484
485 return insert_at(i_element, value);
486 }
487
488 //*********************************************************************
494 //*********************************************************************
495 ETL_OR_STD::pair<iterator, bool> emplace(value_type& value)
496 {
497 return insert(value);
498 }
499
500 //*********************************************************************
506 //*********************************************************************
507 iterator insert(const_iterator /*position*/, const value_type& value)
508 {
509 return insert(value).first;
510 }
511
512 //*********************************************************************
519 //*********************************************************************
520 template <class TIterator>
521 void insert(TIterator first, TIterator last)
522 {
523 while (first != last)
524 {
525 insert(*first);
526 ++first;
527 }
528 }
529
530 //*********************************************************************
534 //*********************************************************************
535 size_t erase(key_parameter_t key)
536 {
537 ETL_OR_STD::pair<iterator, iterator> range = equal_range(key);
538
539 if (range.first == end())
540 {
541 return 0;
542 }
543 else
544 {
545 size_t d = static_cast<size_t>(etl::distance(range.first, range.second));
546 erase(range.first, range.second);
547 return d;
548 }
549 }
550
551#if ETL_USING_CPP11
552 //*********************************************************************
553 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
554 size_t erase(K&& key)
555 {
556 ETL_OR_STD::pair<iterator, iterator> range = equal_range(key);
557
558 if (range.first == end())
559 {
560 return 0U;
561 }
562 else
563 {
564 size_t d = static_cast<size_t>(etl::distance(range.first, range.second));
565 erase(range.first, range.second);
566 return d;
567 }
568 }
569#endif
570
571 //*********************************************************************
574 //*********************************************************************
575 iterator erase(iterator i_element)
576 {
577 return lookup.erase(i_element.ilookup);
578 }
579
580 //*********************************************************************
583 //*********************************************************************
584 iterator erase(const_iterator i_element)
585 {
586 return lookup.erase(i_element.ilookup);
587 }
588
589 //*********************************************************************
595 //*********************************************************************
596 iterator erase(const_iterator first, const_iterator last)
597 {
598 return lookup.erase(first.ilookup, last.ilookup);
599 }
600
601 //*************************************************************************
603 //*************************************************************************
604 void clear()
605 {
606 lookup.clear();
607 }
608
609 //*********************************************************************
613 //*********************************************************************
614 iterator find(key_parameter_t key)
615 {
616 iterator itr = lower_bound(key);
617
618 if (itr != end())
619 {
620 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
621 {
622 return itr;
623 }
624 else
625 {
626 return end();
627 }
628 }
629
630 return end();
631 }
632
633#if ETL_USING_CPP11
634 //*********************************************************************
635 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
636 iterator find(const K& key)
637 {
638 iterator itr = lower_bound(key);
639
640 if (itr != end())
641 {
642 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
643 {
644 return itr;
645 }
646 else
647 {
648 return end();
649 }
650 }
651
652 return end();
653 }
654#endif
655
656 //*********************************************************************
660 //*********************************************************************
661 const_iterator find(key_parameter_t key) const
662 {
663 const_iterator itr = lower_bound(key);
664
665 if (itr != end())
666 {
667 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
668 {
669 return itr;
670 }
671 else
672 {
673 return end();
674 }
675 }
676
677 return end();
678 }
679
680#if ETL_USING_CPP11
681 //*********************************************************************
682 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
683 const_iterator find(const K& key) const
684 {
685 const_iterator itr = lower_bound(key);
686
687 if (itr != end())
688 {
689 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
690 {
691 return itr;
692 }
693 else
694 {
695 return end();
696 }
697 }
698
699 return end();
700 }
701#endif
702
703 //*********************************************************************
707 //*********************************************************************
708 size_t count(key_parameter_t key) const
709 {
710 ETL_OR_STD::pair<const_iterator, const_iterator> range = equal_range(key);
711
712 return static_cast<size_t>(etl::distance(range.first, range.second));
713 }
714
715#if ETL_USING_CPP11
716 //*********************************************************************
717 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
718 size_t count(const K& key) const
719 {
720 ETL_OR_STD::pair<const_iterator, const_iterator> range = equal_range(key);
721
722 return static_cast<size_t>(etl::distance(range.first, range.second));
723 }
724#endif
725
726 //*********************************************************************
730 //*********************************************************************
731 iterator lower_bound(key_parameter_t key)
732 {
733 return etl::lower_bound(begin(), end(), key, compare);
734 }
735
736#if ETL_USING_CPP11
737 //*********************************************************************
738 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
739 iterator lower_bound(const K& key)
740 {
741 return etl::lower_bound(begin(), end(), key, compare);
742 }
743#endif
744
745 //*********************************************************************
749 //*********************************************************************
750 const_iterator lower_bound(key_parameter_t key) const
751 {
752 return etl::lower_bound(cbegin(), cend(), key, compare);
753 }
754
755#if ETL_USING_CPP11
756 //*********************************************************************
757 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
758 const_iterator lower_bound(const K& key) const
759 {
760 return etl::lower_bound(cbegin(), cend(), key, compare);
761 }
762#endif
763
764 //*********************************************************************
768 //*********************************************************************
769 iterator upper_bound(key_parameter_t key)
770 {
771 return etl::upper_bound(begin(), end(), key, compare);
772 }
773
774#if ETL_USING_CPP11
775 //*********************************************************************
776 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
777 iterator upper_bound(const K& key)
778 {
779 return etl::upper_bound(begin(), end(), key, compare);
780 }
781#endif
782
783 //*********************************************************************
787 //*********************************************************************
788 const_iterator upper_bound(key_parameter_t key) const
789 {
790 return etl::upper_bound(begin(), end(), key, compare);
791 }
792
793#if ETL_USING_CPP11
794 //*********************************************************************
795 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
796 const_iterator upper_bound(const K& key) const
797 {
798 return etl::upper_bound(begin(), end(), key, compare);
799 }
800#endif
801
802 //*********************************************************************
806 //*********************************************************************
807 ETL_OR_STD::pair<iterator, iterator> equal_range(key_parameter_t key)
808 {
809 iterator i_lower = etl::lower_bound(begin(), end(), key, compare);
810
811 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, end(), key, compare));
812 }
813
814#if ETL_USING_CPP11
815 //*********************************************************************
816 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
817 ETL_OR_STD::pair<iterator, iterator> equal_range(const K& key)
818 {
819 iterator i_lower = etl::lower_bound(begin(), end(), key, compare);
820
821 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, end(), key, compare));
822 }
823#endif
824
825 //*********************************************************************
829 //*********************************************************************
830 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(key_parameter_t key) const
831 {
832 const_iterator i_lower = etl::lower_bound(cbegin(), cend(), key, compare);
833
834 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, cend(), key, compare));
835 }
836
837#if ETL_USING_CPP11
838 //*********************************************************************
839 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
840 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(const K& key) const
841 {
842 const_iterator i_lower = etl::lower_bound(cbegin(), cend(), key, compare);
843
844 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, cend(), key, compare));
845 }
846#endif
847
848 //*************************************************************************
850 //*************************************************************************
851 bool contains(const TKey& key) const
852 {
853 return find(key) != end();
854 }
855
856#if ETL_USING_CPP11
857 //*************************************************************************
858 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
859 bool contains(const K& k) const
860 {
861 return find(k) != end();
862 }
863#endif
864
865 //*************************************************************************
868 //*************************************************************************
869 size_type size() const
870 {
871 return lookup.size();
872 }
873
874 //*************************************************************************
877 //*************************************************************************
878 bool empty() const
879 {
880 return lookup.empty();
881 }
882
883 //*************************************************************************
886 //*************************************************************************
887 bool full() const
888 {
889 return lookup.full();
890 }
891
892 //*************************************************************************
895 //*************************************************************************
896 size_type capacity() const
897 {
898 return lookup.capacity();
899 }
900
901 //*************************************************************************
904 //*************************************************************************
905 size_type max_size() const
906 {
907 return lookup.max_size();
908 }
909
910 //*************************************************************************
913 //*************************************************************************
914 size_t available() const
915 {
916 return lookup.available();
917 }
918
919 protected:
920
921 //*********************************************************************
923 //*********************************************************************
924 ireference_flat_multimap(lookup_t& lookup_)
925 : lookup(lookup_)
926 {
927 }
928
929 //*********************************************************************
933 //*********************************************************************
934 ETL_OR_STD::pair<iterator, bool> insert_at(iterator i_element, value_type& value)
935 {
936 ETL_OR_STD::pair<iterator, bool> result(end(), false);
937
938 if (i_element == end())
939 {
940 // At the end.
941 lookup.push_back(&value);
942 result.first = --end();
943 result.second = true;
944 }
945 else
946 {
947 // Not at the end.
948 lookup.insert(i_element.ilookup, &value);
949 result.first = i_element;
950 result.second = true;
951 }
952
953 return result;
954 }
955
956 private:
957
958 // Disable copy construction and assignment.
961
962 lookup_t& lookup;
963
964 Compare compare;
965
966 //*************************************************************************
968 //*************************************************************************
969#if defined(ETL_POLYMORPHIC_REFERENCE_FLAT_MULTIMAP) || defined(ETL_POLYMORPHIC_CONTAINERS)
970
971 public:
972
973 virtual ~ireference_flat_multimap() {}
974#else
975
976 protected:
977
979#endif
980 };
981
982 //***************************************************************************
988 //***************************************************************************
989 template <typename TKey, typename TMapped, typename TKeyCompare>
992 {
993 return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
994 }
995
996 //***************************************************************************
1002 //***************************************************************************
1003 template <typename TKey, typename TMapped, typename TKeyCompare>
1009
1010 //***************************************************************************
1017 //***************************************************************************
1018 template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = etl::less<TKey> >
1019 class reference_flat_multimap : public ireference_flat_multimap<TKey, TValue, TCompare>
1020 {
1021 public:
1022
1023 static ETL_CONSTANT size_t MAX_SIZE = MAX_SIZE_;
1024
1025 //*************************************************************************
1027 //*************************************************************************
1029 : ireference_flat_multimap<TKey, TValue, TCompare>(lookup)
1030 {
1031 }
1032
1033 //*************************************************************************
1035 //*************************************************************************
1037 : ireference_flat_multimap<TKey, TValue, TCompare>(lookup)
1038 {
1040 }
1041
1042 //*************************************************************************
1047 //*************************************************************************
1048 template <typename TIterator>
1049 reference_flat_multimap(TIterator first, TIterator last)
1050 : ireference_flat_multimap<TKey, TValue, TCompare>(lookup)
1051 {
1053 }
1054
1055 //*************************************************************************
1057 //*************************************************************************
1062
1063 private:
1064
1065 typedef typename ireference_flat_multimap<TKey, TValue, TCompare>::value_type node_t;
1066
1067 // The vector that stores pointers to the nodes.
1069 };
1070
1071 template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare>
1072 ETL_CONSTANT size_t reference_flat_multimap< TKey, TValue, MAX_SIZE_, TCompare>::MAX_SIZE;
1073
1074 //*************************************************************************
1076 //*************************************************************************
1077#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
1078 template <typename... TPairs>
1079 reference_flat_multimap(TPairs...) -> reference_flat_multimap< typename etl::nth_type_t<0, TPairs...>::first_type,
1080 typename etl::nth_type_t<0, TPairs...>::second_type, sizeof...(TPairs)>;
1081#endif
1082
1083 //*************************************************************************
1085 //*************************************************************************
1086#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
1087 template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey>, typename... TPairs>
1088 constexpr auto make_reference_flat_multimap(TPairs&&... pairs) -> etl::reference_flat_multimap<TKey, TMapped, sizeof...(TPairs), TKeyCompare>
1089 {
1090 return {etl::forward<TPairs>(pairs)...};
1091 }
1092#endif
1093} // namespace etl
1094
1095#endif
Definition reference_flat_multimap.h:68
Definition reference_flat_multimap.h:107
Definition reference_flat_multimap.h:85
const_reverse_iterator crbegin() const
Definition reference_flat_multimap.h:429
iterator erase(const_iterator i_element)
Definition reference_flat_multimap.h:584
size_t count(key_parameter_t key) const
Definition reference_flat_multimap.h:708
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition reference_flat_multimap.h:807
iterator lower_bound(key_parameter_t key)
Definition reference_flat_multimap.h:731
ETL_OR_STD::pair< iterator, bool > emplace(value_type &value)
Definition reference_flat_multimap.h:495
const_iterator find(key_parameter_t key) const
Definition reference_flat_multimap.h:661
reverse_iterator rbegin()
Definition reference_flat_multimap.h:386
const_reverse_iterator crend() const
Definition reference_flat_multimap.h:440
iterator upper_bound(key_parameter_t key)
Definition reference_flat_multimap.h:769
bool empty() const
Definition reference_flat_multimap.h:878
const_reverse_iterator rbegin() const
Definition reference_flat_multimap.h:397
const_iterator cbegin() const
Definition reference_flat_multimap.h:367
size_type size() const
Definition reference_flat_multimap.h:869
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, value_type &value)
Definition reference_flat_multimap.h:934
size_t available() const
Definition reference_flat_multimap.h:914
iterator erase(const_iterator first, const_iterator last)
Definition reference_flat_multimap.h:596
iterator insert(const_iterator, const value_type &value)
Definition reference_flat_multimap.h:507
bool full() const
Definition reference_flat_multimap.h:887
size_t erase(key_parameter_t key)
Definition reference_flat_multimap.h:535
bool contains(const TKey &key) const
Check if the map contains the key.
Definition reference_flat_multimap.h:851
~ireference_flat_multimap()
Destructor.
Definition reference_flat_multimap.h:978
const_iterator end() const
Definition reference_flat_multimap.h:357
const_iterator upper_bound(key_parameter_t key) const
Definition reference_flat_multimap.h:788
const_reverse_iterator rend() const
Definition reference_flat_multimap.h:418
iterator begin()
Definition reference_flat_multimap.h:329
ETL_OR_STD::pair< iterator, bool > insert(value_type &value)
Definition reference_flat_multimap.h:477
iterator end()
Definition reference_flat_multimap.h:348
iterator find(key_parameter_t key)
Definition reference_flat_multimap.h:614
const_iterator cend() const
Definition reference_flat_multimap.h:376
size_type max_size() const
Definition reference_flat_multimap.h:905
void clear()
Clears the reference_flat_multimap.
Definition reference_flat_multimap.h:604
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition reference_flat_multimap.h:830
void insert(TIterator first, TIterator last)
Definition reference_flat_multimap.h:521
ireference_flat_multimap(lookup_t &lookup_)
Constructor.
Definition reference_flat_multimap.h:924
void assign(TIterator first, TIterator last)
Definition reference_flat_multimap.h:455
size_type capacity() const
Definition reference_flat_multimap.h:896
iterator erase(iterator i_element)
Definition reference_flat_multimap.h:575
reverse_iterator rend()
Definition reference_flat_multimap.h:407
const_iterator lower_bound(key_parameter_t key) const
Definition reference_flat_multimap.h:750
const_iterator begin() const
Definition reference_flat_multimap.h:339
Definition vector.h:65
Definition reference_flat_multimap.h:1020
~reference_flat_multimap()
Destructor.
Definition reference_flat_multimap.h:1058
reference_flat_multimap()
Constructor.
Definition reference_flat_multimap.h:1028
reference_flat_multimap(const reference_flat_multimap &other)
Copy constructor.
Definition reference_flat_multimap.h:1036
reference_flat_multimap(TIterator first, TIterator last)
Definition reference_flat_multimap.h:1049
#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
TContainer::iterator end(TContainer &container)
Definition iterator.h:1166
Definition compare.h:51
iterator
Definition iterator.h:482
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