Vector-like container consisting of few elements on stack and switches to dynamic allocation vector if needed.
More...
template<typename StoredType, std::size_t StaticVectorSize, typename Allocator = std::allocator<StoredType>>
class ASmallVector< StoredType, StaticVectorSize, Allocator >
Vector-like container consisting of few elements on stack and switches to dynamic allocation vector if needed.
- Template Parameters
-
StoredType | stored type |
StaticVectorSize | how many elements can be stored without dynamic allocation |
Allocator | allocation |
Vector-like container optimized for the case when it contains up to StaticVectorSize in place, avoiding dynamic allocation. In case when element count exceeds StaticVectorSize, ASmallVector seamlessly switches to traditional dynamic allocation vector.
- Examples
- /github/workspace/aui.views/src/AUI/View/AView.h.
|
| ASmallVector (ASmallVector &&rhs) noexcept |
|
constexpr StoredType * | data () noexcept |
|
constexpr const StoredType * | data () const noexcept |
|
constexpr iterator | begin () noexcept |
|
constexpr const_iterator | begin () const noexcept |
|
constexpr iterator | end () noexcept |
|
constexpr const_iterator | end () const noexcept |
|
constexpr StoredType & | front () noexcept |
|
constexpr StoredType & | back () noexcept |
|
constexpr const StoredType & | front () const noexcept |
|
constexpr const StoredType & | back () const noexcept |
|
constexpr void | push_back (StoredType value) noexcept |
|
constexpr void | push_front (StoredType value) noexcept |
|
constexpr void | pop_back () noexcept |
|
constexpr void | pop_front () noexcept |
|
constexpr StoredType & | operator[] (std::size_t index) noexcept |
|
constexpr StoredType & | operator[] (std::size_t index) const noexcept |
|
constexpr bool | empty () const noexcept |
|
constexpr void | clear () noexcept |
|
std::size_t | size () const noexcept |
|
bool | isInplaceAllocated () const noexcept |
|
template<typename OtherIterator > |
constexpr iterator | insert (iterator at, OtherIterator begin, OtherIterator end) |
|
constexpr iterator | erase (iterator begin, iterator end) noexcept |
|
constexpr iterator | insert (iterator at, StoredType value) |
|
constexpr iterator | erase (iterator at) |
|
template<typename OtherContainer > |
iterator | insertAll (const OtherContainer &c) noexcept |
|
template<typename OtherContainer > |
iterator | insertAll (OtherContainer &&c) noexcept |
|
template<typename OtherContainer > |
iterator | insertAll (iterator at, const OtherContainer &c) noexcept |
|
template<typename OtherContainer > |
iterator | insertAll (iterator at, OtherContainer &&c) noexcept |
|
void | removeAll (const StoredType &item) noexcept |
|
template<typename T , aui::mapper< const StoredType &, const T & > Projection> |
void | removeAll (const T &item, Projection projection) noexcept |
|
void | removeFirst (const StoredType &item) noexcept |
|
template<typename OtherContainer > |
bool | isSubsetOf (const OtherContainer &c) const noexcept |
|
bool | contains (const StoredType &value) const noexcept |
|
std::size_t | sizeInBytes () const noexcept |
|
StoredType & | at (std::size_t index) |
|
const StoredType & | at (std::size_t index) const |
|
self & | operator<< (const StoredType &rhs) noexcept |
|
self & | operator<< (StoredType &&rhs) noexcept |
|
template<typename OtherContainer , std::enable_if_t<!std::is_convertible_v< OtherContainer, StoredType >, bool > = true> |
self & | operator<< (const OtherContainer &c) noexcept |
|
template<typename OtherContainer , std::enable_if_t<!std::is_convertible_v< OtherContainer, StoredType >, bool > = true> |
self & | operator<< (OtherContainer &&c) noexcept |
|
StoredType & | first () noexcept |
|
const StoredType & | first () const noexcept |
|
StoredType & | last () noexcept |
|
const StoredType & | last () const noexcept |
|
size_t | indexOf (const StoredType &value) const noexcept |
|
void | sort () noexcept |
|
template<typename Comparator > |
void | sort (Comparator &&comparator) noexcept |
|
template<aui::predicate< StoredType > Predicate> |
StoredType * | findIf (Predicate &&predicate) noexcept |
| Finds element by predicate. More...
|
|
template<typename T , aui::mapper< const StoredType &, const T & > Projection> |
StoredType * | findIf (const T &value, Projection &&projection) noexcept |
| Finds element by value. More...
|
|
void | removeAt (size_t index) noexcept |
|
template<typename Predicate > |
void | removeIf (Predicate &&predicate) noexcept |
|
ASet< StoredType > | toSet () const noexcept |
|
template<aui::invocable< const StoredType & > UnaryOperation> |
auto | map (UnaryOperation &&transformer) const -> AVector< decltype(transformer(std::declval< StoredType >()))> |
|
template<aui::invocable< const StoredType & > UnaryOperation> |
auto | toMap (UnaryOperation &&transformer) const -> AMap< decltype(transformer(std::declval< StoredType >()).first), decltype(transformer(std::declval< StoredType >()).second)> |
|
template<aui::invocable< StoredType & > UnaryOperation> |
auto | toMap (UnaryOperation &&transformer) -> AMap< decltype(transformer(std::declval< StoredType >()).first), decltype(transformer(std::declval< StoredType >()).second)> |
|
template<aui::predicate< const StoredType & > Predicate> |
self | filter (Predicate &&predicate) |
|