Embedded Template Library  1.0
flat_set.h
Go to the documentation of this file.
1 
3 /******************************************************************************
4 The MIT License(MIT)
5 
6 Embedded Template Library.
7 https://github.com/ETLCPP/etl
8 https://www.etlcpp.com
9 
10 Copyright(c) 2015 jwellbelove
11 
12 Permission is hereby granted, free of charge, to any person obtaining a copy
13 of this software and associated documentation files(the "Software"), to deal
14 in the Software without restriction, including without limitation the rights
15 to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16 copies of the Software, and to permit persons to whom the Software is
17 furnished to do so, subject to the following conditions :
18 
19 The above copyright notice and this permission notice shall be included in all
20 copies or substantial portions of the Software.
21 
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 SOFTWARE.
29 ******************************************************************************/
30 
31 #ifndef ETL_FLAT_SET_INCLUDED
32 #define ETL_FLAT_SET_INCLUDED
33 
34 #include "platform.h"
35 #include "reference_flat_set.h"
36 #include "pool.h"
37 #include "placement_new.h"
38 
39 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
40  #include <initializer_list>
41 #endif
42 
43 #undef ETL_FILE
44 #define ETL_FILE "5"
45 
46 //*****************************************************************************
52 //*****************************************************************************
53 
54 namespace etl
55 {
56  //***************************************************************************
60  //***************************************************************************
61  template <typename T, typename TKeyCompare = etl::less<T> >
62  class iflat_set : private etl::ireference_flat_set<T, TKeyCompare>
63  {
64  private:
65 
67  typedef typename refset_t::lookup_t lookup_t;
68  typedef etl::ipool storage_t;
69 
70  public:
71 
72  typedef T key_type;
73  typedef T value_type;
74  typedef TKeyCompare key_compare;
75  typedef value_type& reference;
76  typedef const value_type& const_reference;
77 #if ETL_CPP11_SUPPORTED
78  typedef value_type&& rvalue_reference;
79 #endif
80  typedef value_type* pointer;
81  typedef const value_type* const_pointer;
82  typedef size_t size_type;
83 
84  typedef typename refset_t::iterator iterator;
86 
87  typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
88  typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
89  typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
90 
91  public:
92 
93  //*********************************************************************
96  //*********************************************************************
98  {
99  return refset_t::begin();
100  }
101 
102  //*********************************************************************
105  //*********************************************************************
107  {
108  return refset_t::begin();
109  }
110 
111  //*********************************************************************
114  //*********************************************************************
116  {
117  return refset_t::end();
118  }
119 
120  //*********************************************************************
123  //*********************************************************************
125  {
126  return refset_t::end();
127  }
128 
129  //*********************************************************************
132  //*********************************************************************
134  {
135  return refset_t::cbegin();
136  }
137 
138  //*********************************************************************
141  //*********************************************************************
143  {
144  return refset_t::cend();
145  }
146 
147  //*********************************************************************
150  //*********************************************************************
151  reverse_iterator rbegin()
152  {
153  return refset_t::rbegin();
154  }
155 
156  //*********************************************************************
159  //*********************************************************************
160  const_reverse_iterator rbegin() const
161  {
162  return refset_t::rbegin();
163  }
164 
165  //*********************************************************************
168  //*********************************************************************
169  reverse_iterator rend()
170  {
171  return refset_t::rend();
172  }
173 
174  //*********************************************************************
177  //*********************************************************************
178  const_reverse_iterator rend() const
179  {
180  return refset_t::rend();
181  }
182 
183  //*********************************************************************
186  //*********************************************************************
187  const_reverse_iterator crbegin() const
188  {
189  return refset_t::crbegin();
190  }
191 
192  //*********************************************************************
195  //*********************************************************************
196  const_reverse_iterator crend() const
197  {
198  return refset_t::crend();
199  }
200 
201  //*********************************************************************
207  //*********************************************************************
208  template <typename TIterator>
209  void assign(TIterator first, TIterator last)
210  {
211 #if defined(ETL_DEBUG)
212  difference_type d = etl::distance(first, last);
213  ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_set_full));
214 #endif
215 
216  clear();
217 
218  while (first != last)
219  {
220  insert(*first++);
221  }
222  }
223 
224  //*********************************************************************
228  //*********************************************************************
229  ETL_OR_STD::pair<iterator, bool> insert(const_reference value)
230  {
231  iterator i_element = lower_bound(value);
232 
233  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
234 
235  // Doesn't already exist?
236  if ((i_element == end()) || compare(value, *i_element))
237  {
238  ETL_ASSERT(!refset_t::full(), ETL_ERROR(flat_set_full));
239 
240  value_type* pvalue = storage.allocate<value_type>();
241  ::new (pvalue) value_type(value);
242  ETL_INCREMENT_DEBUG_COUNT
243  result = refset_t::insert_at(i_element, *pvalue);
244  }
245 
246  return result;
247  }
248 
249 #if ETL_CPP11_SUPPORTED
250  //*********************************************************************
254  //*********************************************************************
255  ETL_OR_STD::pair<iterator, bool> insert(rvalue_reference value)
256  {
257  iterator i_element = lower_bound(value);
258 
259  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
260 
261  // Doesn't already exist?
262  if ((i_element == end()) || compare(value, *i_element))
263  {
264  ETL_ASSERT(!refset_t::full(), ETL_ERROR(flat_set_full));
265 
266  value_type* pvalue = storage.allocate<value_type>();
267  ::new (pvalue) value_type(etl::move(value));
268  ETL_INCREMENT_DEBUG_COUNT
269  result = refset_t::insert_at(i_element, *pvalue);
270  }
271 
272  return result;
273  }
274 #endif
275 
276  //*********************************************************************
281  //*********************************************************************
282  iterator insert(iterator position, const_reference value)
283  {
284  return insert(value).first;
285  }
286 
287 #if ETL_CPP11_SUPPORTED
288  //*********************************************************************
293  //*********************************************************************
294  iterator insert(iterator position, rvalue_reference value)
295  {
296  return insert(etl::move(value)).first;
297  }
298 #endif
299 
300  //*********************************************************************
306  //*********************************************************************
307  template <class TIterator>
308  void insert(TIterator first, TIterator last)
309  {
310  while (first != last)
311  {
312  insert(*first++);
313  }
314  }
315 
316  //*************************************************************************
318  //*************************************************************************
319  ETL_OR_STD::pair<iterator, bool> emplace(const_reference value)
320  {
321  return insert(value);
322  }
323 
324  //*************************************************************************
326  //*************************************************************************
327 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT
328  template <typename ... Args>
329  ETL_OR_STD::pair<iterator, bool> emplace(Args && ... args)
330  {
331  ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
332 
333  ETL_OR_STD::pair<iterator, bool> result;
334 
335  // Create it.
336  value_type* pvalue = storage.allocate<value_type>();
337  ::new (pvalue) value_type(etl::forward<Args>(args)...);
338 
339  iterator i_element = lower_bound(*pvalue);
340 
341  // Doesn't already exist?
342  if ((i_element == end()) || compare(*pvalue, *i_element))
343  {
344  ETL_INCREMENT_DEBUG_COUNT
345  result = refset_t::insert_at(i_element, *pvalue);
346  }
347  else
348  {
349  // Destroy it.
350  pvalue->~value_type();
351  storage.release(pvalue);
352  result = ETL_OR_STD::pair<iterator, bool>(end(), false);
353  }
354 
355  return result;
356  }
357 #else
358  //*************************************************************************
360  //*************************************************************************
361  template <typename T1>
362  ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1)
363  {
364  ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
365 
366  ETL_OR_STD::pair<iterator, bool> result;
367 
368  // Create it.
369  value_type* pvalue = storage.allocate<value_type>();
370  ::new (pvalue) value_type(value1);
371 
372  iterator i_element = lower_bound(*pvalue);
373 
374  // Doesn't already exist?
375  if ((i_element == end()) || compare(*pvalue, *i_element))
376  {
377  ETL_INCREMENT_DEBUG_COUNT
378  result = refset_t::insert_at(i_element, *pvalue);
379  }
380  else
381  {
382  // Destroy it.
383  pvalue->~value_type();
384  storage.release(pvalue);
385  result = ETL_OR_STD::pair<iterator, bool>(end(), false);
386  }
387 
388  return result;
389  }
390 
391  //*************************************************************************
393  //*************************************************************************
394  template <typename T1, typename T2>
395  ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2)
396  {
397  ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
398 
399  ETL_OR_STD::pair<iterator, bool> result;
400 
401  // Create it.
402  value_type* pvalue = storage.allocate<value_type>();
403  ::new (pvalue) value_type(value1, value2);
404 
405  iterator i_element = lower_bound(*pvalue);
406 
407  // Doesn't already exist?
408  if ((i_element == end()) || compare(*pvalue, *i_element))
409  {
410  ETL_INCREMENT_DEBUG_COUNT
411  result = refset_t::insert_at(i_element, *pvalue);
412  }
413  else
414  {
415  // Destroy it.
416  pvalue->~value_type();
417  storage.release(pvalue);
418  result = ETL_OR_STD::pair<iterator, bool>(end(), false);
419  }
420 
421  return result;
422  }
423 
424  //*************************************************************************
426  //*************************************************************************
427  template <typename T1, typename T2, typename T3>
428  ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3)
429  {
430  ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
431 
432  ETL_OR_STD::pair<iterator, bool> result;
433 
434  // Create it.
435  value_type* pvalue = storage.allocate<value_type>();
436  ::new (pvalue) value_type(value1, value2, value3);
437 
438  iterator i_element = lower_bound(*pvalue);
439 
440  // Doesn't already exist?
441  if ((i_element == end()) || compare(*pvalue, *i_element))
442  {
443  ETL_INCREMENT_DEBUG_COUNT
444  result = refset_t::insert_at(i_element, *pvalue);
445  }
446  else
447  {
448  // Destroy it.
449  pvalue->~value_type();
450  storage.release(pvalue);
451  result = ETL_OR_STD::pair<iterator, bool>(end(), false);
452  }
453 
454  return result;
455  }
456 
457  //*************************************************************************
459  //*************************************************************************
460  template <typename T1, typename T2, typename T3, typename T4>
461  ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
462  {
463  ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
464 
465  ETL_OR_STD::pair<iterator, bool> result;
466 
467  // Create it.
468  value_type* pvalue = storage.allocate<value_type>();
469  ::new (pvalue) value_type(value1, value2, value3, value4);
470 
471  iterator i_element = lower_bound(*pvalue);
472 
473  // Doesn't already exist?
474  if ((i_element == end()) || compare(*pvalue, *i_element))
475  {
476  ETL_INCREMENT_DEBUG_COUNT
477  result = refset_t::insert_at(i_element, *pvalue);
478  }
479  else
480  {
481  // Destroy it.
482  pvalue->~value_type();
483  storage.release(pvalue);
484  result = ETL_OR_STD::pair<iterator, bool>(end(), false);
485  }
486 
487  return result;
488  }
489 #endif
490 
491  //*********************************************************************
495  //*********************************************************************
496  size_t erase(const_reference key)
497  {
498  iterator i_element = find(key);
499 
500  if (i_element == end())
501  {
502  return 0;
503  }
504  else
505  {
506  etl::destroy_at(etl::addressof(*i_element));
507  storage.release(etl::addressof(*i_element));
508  refset_t::erase(i_element);
509  ETL_DECREMENT_DEBUG_COUNT
510  return 1;
511  }
512  }
513 
514  //*********************************************************************
517  //*********************************************************************
518  void erase(iterator i_element)
519  {
520  etl::destroy_at(etl::addressof(*i_element));
521  storage.release(etl::addressof(*i_element));
522  refset_t::erase(i_element);
523  ETL_DECREMENT_DEBUG_COUNT
524  }
525 
526  //*********************************************************************
532  //*********************************************************************
533  void erase(iterator first, iterator last)
534  {
535  iterator itr = first;
536 
537  while (itr != last)
538  {
540  storage.release(etl::addressof(*itr));
541  ++itr;
542  ETL_DECREMENT_DEBUG_COUNT
543  }
544 
545  refset_t::erase(first, last);
546  }
547 
548  //*************************************************************************
550  //*************************************************************************
551  void clear()
552  {
554  {
555  storage.release_all();
556  }
557  else
558  {
559  iterator itr = begin();
560 
561  while (itr != end())
562  {
564  storage.release(etl::addressof(*itr));
565  ++itr;
566  ETL_DECREMENT_DEBUG_COUNT
567  }
568  }
569 
570  ETL_RESET_DEBUG_COUNT
571  refset_t::clear();
572  }
573 
574  //*********************************************************************
578  //*********************************************************************
579  iterator find(const_reference key)
580  {
581  return refset_t::find(key);
582  }
583 
584  //*********************************************************************
588  //*********************************************************************
589  const_iterator find(const_reference key) const
590  {
591  return refset_t::find(key);
592  }
593 
594  //*********************************************************************
598  //*********************************************************************
599  size_t count(const_reference key) const
600  {
601  return refset_t::count(key);
602  }
603 
604  //*********************************************************************
608  //*********************************************************************
609  iterator lower_bound(const_reference key)
610  {
611  return refset_t::lower_bound(key);
612  }
613 
614  //*********************************************************************
618  //*********************************************************************
619  const_iterator lower_bound(const_reference key) const
620  {
621  return refset_t::lower_bound(key);
622  }
623 
624  //*********************************************************************
628  //*********************************************************************
629  iterator upper_bound(const_reference key)
630  {
631  return refset_t::upper_bound(key);
632  }
633 
634  //*********************************************************************
638  //*********************************************************************
639  const_iterator upper_bound(const_reference key) const
640  {
641  return refset_t::upper_bound(key);
642  }
643 
644  //*********************************************************************
648  //*********************************************************************
649  ETL_OR_STD::pair<iterator, iterator> equal_range(const_reference key)
650  {
651  return refset_t::equal_range(key);
652  }
653 
654  //*********************************************************************
658  //*********************************************************************
659  ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(const_reference key) const
660  {
661  return refset_t::upper_bound(key);
662  }
663 
664  //*************************************************************************
666  //*************************************************************************
668  {
669  if (&rhs != this)
670  {
671  assign(rhs.cbegin(), rhs.cend());
672  }
673 
674  return *this;
675  }
676 
677 #if ETL_CPP11_SUPPORTED
678  //*************************************************************************
680  //*************************************************************************
682  {
683  move_container(etl::move(rhs));
684 
685  return *this;
686  }
687 #endif
688 
689  //*************************************************************************
692  //*************************************************************************
693  size_type size() const
694  {
695  return refset_t::size();
696  }
697 
698  //*************************************************************************
701  //*************************************************************************
702  bool empty() const
703  {
704  return refset_t::empty();
705  }
706 
707  //*************************************************************************
710  //*************************************************************************
711  bool full() const
712  {
713  return refset_t::full();
714  }
715 
716  //*************************************************************************
719  //*************************************************************************
720  size_type capacity() const
721  {
722  return refset_t::capacity();
723  }
724 
725  //*************************************************************************
728  //*************************************************************************
729  size_type max_size() const
730  {
731  return refset_t::max_size();
732  }
733 
734  //*************************************************************************
737  //*************************************************************************
738  size_t available() const
739  {
740  return refset_t::available();
741  }
742 
743  protected:
744 
745  //*********************************************************************
747  //*********************************************************************
748  iflat_set(lookup_t& lookup_, storage_t& storage_)
749  : refset_t(lookup_),
750  storage(storage_)
751  {
752  }
753 
754 #if ETL_CPP11_SUPPORTED
755  //*************************************************************************
758  //*************************************************************************
759  void move_container(iflat_set&& rhs)
760  {
761  if (&rhs != this)
762  {
763  this->clear();
764 
765  etl::iflat_set<T, TKeyCompare>::iterator first = rhs.begin();
767 
768  // Add all of the elements.
769  while (first != last)
770  {
771  this->insert(etl::move(*first++));
772  }
773  }
774  }
775 #endif
776 
777  private:
778 
779  // Disable copy construction.
780  iflat_set(const iflat_set&);
781 
782  storage_t& storage;
783 
784  TKeyCompare compare;
785 
787  ETL_DECLARE_DEBUG_COUNT
788 
789  //*************************************************************************
791  //*************************************************************************
792 #if defined(ETL_POLYMORPHIC_FLAT_SET) || defined(ETL_POLYMORPHIC_CONTAINERS)
793  public:
794  virtual ~iflat_set()
795  {
796  }
797 #else
798  protected:
800  {
801  }
802 #endif
803  };
804 
805  //***************************************************************************
811  //***************************************************************************
812  template <typename T, typename TKeyCompare>
814  {
815  return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
816  }
817 
818  //***************************************************************************
824  //***************************************************************************
825  template <typename T, typename TKeyCompare>
827  {
828  return !(lhs == rhs);
829  }
830 
831  //***************************************************************************
837  //***************************************************************************
838  template <typename T, const size_t MAX_SIZE_, typename TCompare = etl::less<T> >
839  class flat_set : public etl::iflat_set<T, TCompare>
840  {
841  public:
842 
843  static const size_t MAX_SIZE = MAX_SIZE_;
844 
845  //*************************************************************************
847  //*************************************************************************
849  : etl::iflat_set<T, TCompare>(lookup, storage)
850  {
851  }
852 
853  //*************************************************************************
855  //*************************************************************************
856  flat_set(const flat_set& other)
857  : etl::iflat_set<T, TCompare>(lookup, storage)
858  {
859  this->assign(other.cbegin(), other.cend());
860  }
861 
862 #if ETL_CPP11_SUPPORTED
863  //*************************************************************************
865  //*************************************************************************
866  flat_set(flat_set&& other)
867  : etl::iflat_set<T, TCompare>(lookup, storage)
868  {
869  if (&other != this)
870  {
871  this->move_container(etl::move(other));
872  }
873  }
874 #endif
875 
876  //*************************************************************************
881  //*************************************************************************
882  template <typename TIterator>
883  flat_set(TIterator first, TIterator last)
884  : etl::iflat_set<T, TCompare>(lookup, storage)
885  {
886  this->assign(first, last);
887  }
888 
889 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
890  //*************************************************************************
892  //*************************************************************************
893  flat_set(std::initializer_list<T> init)
894  : etl::iflat_set<T, TCompare>(lookup, storage)
895  {
896  this->assign(init.begin(), init.end());
897  }
898 #endif
899 
900  //*************************************************************************
902  //*************************************************************************
904  {
905  this->clear();
906  }
907 
908  //*************************************************************************
910  //*************************************************************************
912  {
913  if (&rhs != this)
914  {
915  this->assign(rhs.cbegin(), rhs.cend());
916  }
917 
918  return *this;
919  }
920 
921 #if ETL_CPP11_SUPPORTED
922  //*************************************************************************
924  //*************************************************************************
926  {
927  if (&rhs != this)
928  {
929  this->move_container(etl::move(rhs));
930  }
931 
932  return *this;
933  }
934 #endif
935 
936  private:
937 
938  typedef typename etl::iflat_set<T, TCompare>::value_type node_t;
939 
940  // The pool of nodes.
942 
943  // The vector that stores pointers to the nodes.
945  };
946 
947  //*************************************************************************
949  //*************************************************************************
950 #if ETL_CPP17_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
951  template <typename T, typename... Ts>
952  flat_set(T, Ts...)
953  ->flat_set<etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), T>, 1U + sizeof...(Ts)>;
954 #endif
955 }
956 
957 #undef ETL_FILE
958 
959 #endif
Definition: reference_flat_set.h:74
Definition: reference_flat_set.h:223
Definition: reference_flat_set.h:124
Definition: reference_flat_set.h:104
size_type capacity() const
Definition: reference_flat_set.h:693
size_t available() const
Definition: reference_flat_set.h:711
iterator upper_bound(parameter_t key)
Definition: reference_flat_set.h:627
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, reference value)
Definition: reference_flat_set.h:731
const_reverse_iterator crbegin() const
Definition: reference_flat_set.h:419
iterator begin()
Definition: reference_flat_set.h:329
size_t erase(parameter_t key)
Definition: reference_flat_set.h:500
iterator end()
Definition: reference_flat_set.h:347
const_iterator cend() const
Definition: reference_flat_set.h:374
const_iterator cbegin() const
Definition: reference_flat_set.h:365
iterator find(parameter_t key)
Definition: reference_flat_set.h:549
size_type max_size() const
Definition: reference_flat_set.h:702
const_reverse_iterator crend() const
Definition: reference_flat_set.h:428
bool empty() const
Definition: reference_flat_set.h:675
size_type size() const
Definition: reference_flat_set.h:666
reverse_iterator rbegin()
Definition: reference_flat_set.h:383
ETL_OR_STD::pair< iterator, iterator > equal_range(parameter_t key)
Definition: reference_flat_set.h:647
size_t count(parameter_t key) const
Definition: reference_flat_set.h:597
bool full() const
Definition: reference_flat_set.h:684
void clear()
Clears the reference_flat_set.
Definition: reference_flat_set.h:539
iterator lower_bound(parameter_t key)
Definition: reference_flat_set.h:607
reverse_iterator rend()
Definition: reference_flat_set.h:401
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
const_iterator cbegin() const
Definition: flat_set.h:133
ETL_OR_STD::pair< iterator, bool > emplace(const_reference value)
Emplaces a value to the set.
Definition: flat_set.h:319
~iflat_set()
Internal debugging.
Definition: flat_set.h:799
size_t available() const
Definition: flat_set.h:738
flat_set()
Constructor.
Definition: flat_set.h:848
iterator lower_bound(const_reference key)
Definition: flat_set.h:609
iterator begin()
Definition: flat_set.h:97
iflat_set & operator=(const iflat_set &rhs)
Assignment operator.
Definition: flat_set.h:667
iflat_set(lookup_t &lookup_, storage_t &storage_)
Constructor.
Definition: flat_set.h:748
size_t erase(const_reference key)
Definition: flat_set.h:496
void erase(iterator i_element)
Definition: flat_set.h:518
const_iterator begin() const
Definition: flat_set.h:106
const_reverse_iterator crbegin() const
Definition: flat_set.h:187
size_type max_size() const
Definition: flat_set.h:729
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1)
Emplaces a value to the set.
Definition: flat_set.h:362
size_type capacity() const
Definition: flat_set.h:720
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2)
Emplaces a value to the set.
Definition: flat_set.h:395
size_t count(const_reference key) const
Definition: flat_set.h:599
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the set.
Definition: flat_set.h:428
iterator find(const_reference key)
Definition: flat_set.h:579
void erase(iterator first, iterator last)
Definition: flat_set.h:533
bool empty() const
Definition: flat_set.h:702
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Emplaces a value to the set.
Definition: flat_set.h:461
ETL_OR_STD::pair< iterator, iterator > equal_range(const_reference key)
Definition: flat_set.h:649
const_iterator upper_bound(const_reference key) const
Definition: flat_set.h:639
~flat_set()
Destructor.
Definition: flat_set.h:903
iterator insert(iterator position, const_reference value)
Definition: flat_set.h:282
const_iterator end() const
Definition: flat_set.h:124
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(const_reference key) const
Definition: flat_set.h:659
bool full() const
Definition: flat_set.h:711
iterator end()
Definition: flat_set.h:115
const_iterator find(const_reference key) const
Definition: flat_set.h:589
const_reverse_iterator rbegin() const
Definition: flat_set.h:160
void insert(TIterator first, TIterator last)
Definition: flat_set.h:308
flat_set & operator=(const flat_set &rhs)
Assignment operator.
Definition: flat_set.h:911
const_reverse_iterator crend() const
Definition: flat_set.h:196
iterator upper_bound(const_reference key)
Definition: flat_set.h:629
void assign(TIterator first, TIterator last)
Definition: flat_set.h:209
reverse_iterator rend()
Definition: flat_set.h:169
flat_set(const flat_set &other)
Copy constructor.
Definition: flat_set.h:856
size_type size() const
Definition: flat_set.h:693
reverse_iterator rbegin()
Definition: flat_set.h:151
const_reverse_iterator rend() const
Definition: flat_set.h:178
const_iterator cend() const
Definition: flat_set.h:142
ETL_OR_STD::pair< iterator, bool > insert(const_reference value)
Definition: flat_set.h:229
flat_set(TIterator first, TIterator last)
Definition: flat_set.h:883
void clear()
Clears the flat_set.
Definition: flat_set.h:551
const_iterator lower_bound(const_reference key) const
Definition: flat_set.h:619
Definition: flat_set.h:840
Definition: flat_set.h:63
etl::enable_if< etl::is_trivially_destructible< T >::value, void >::type destroy_at(T *)
Definition: memory.h:949
T * addressof(T &t)
Definition: memory.h:61
void release_all()
Release all objects in the pool.
Definition: pool.h:264
void release(const void *const p_object)
Definition: pool.h:255
T * allocate()
Definition: pool.h:129
Definition: pool.h:118
is_trivially_destructible
Definition: type_traits_generator.h:1171
Definition: vector.h:80
Definition: absolute.h:37
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:594
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:582
Definition: compare.h:52
iterator
Definition: iterator.h:422