FastLED 3.9.15
Loading...
Searching...
No Matches

◆ insert()

template<typename T, typename LessThan = fl::less<T>>
bool fl::SortedHeapVector< T, LessThan >::insert ( const T & value,
InsertResult * result = nullptr )
inline

Definition at line 777 of file vector.h.

777 {
778 // Find insertion point using binary search
780 if (pos != end() && !mLess(value, *pos) && !mLess(*pos, value)) {
781 // return false; // Already inserted.
782 if (result) {
783 // *result = kExists;
785 }
786
787 return false;
788 }
789 if (mArray.size() >= mMaxSize) {
790 // return false; // Too full
791 if (result) {
793 }
794 return false;
795 }
796 mArray.insert(pos, value);
797 if (result) {
798 *result = kInserted;
799 }
800
801 return true;
802 }
iterator lower_bound(const T &value)
Definition vector.h:806
HeapVector< T > mArray
Definition vector.h:749
iterator end()
Definition vector.h:879
fl::size mMaxSize
Definition vector.h:751
HeapVector< T >::iterator iterator
Definition vector.h:754