A vector-like container template which stores elements as array of pointers to each element
- vptrlist.h - implemented as inherence of std::vector<std::unique_ptr> (works faster more stable)
- ptrlist.h - implemented from scratch (early implementation)
- C++11 support (Tested on GCC 5, Clang and MSVC2015)
Just include vptrlist.h into your project and use the class VPtrList by same way as well known std::vector. Useful in case when elements are must have persistent address to be able have an external pointers to each of them.
- Address of every element is persistent (until copy entire array)
- Has extra functions:
bool contains(const T &item) const;- to check existing of element by it's contentssize_t indexOf(const T &item) const;- finds item at begin and returns index of it or -1 if item is not foundssize_t lastIndexOf(const T &item) const;- finds item at утв and returns index of it or -1 if item is not founditerator find(const T &item);- finds item at begin and returns iterator of it or .end() if item is not founditerator find_last_of(const T &item)- finds item at end and returns iterator of it or .rend() if item is not founditerator find(const T &item, iterator beg);- finds item at specified position and returns iterator of it or .end() if item is not founditerator find_last_of(const T &item)- finds item at end and returns iterator of it or .rend() if item is not founditerator find_last_of(const T &item, reverse_iterator beg)- finds item at specified position and returns iterator of it or .rend() if item is not foundvoid removeOne(const T &item)- finds item by content and removes it and stops on first casevoid removeAll(const T &item)- find all items by same content and remove all of them, and stop on reaching endvoid removeAt(size_t at)- remove item by indexvoid removeAt(size_t at, size_t num)- remove range of items starts from index and to count of themvoid pop_front()- removes first itemvoid swap(size_t from, size_t to)- internally swap two elements between their positionsvoid move(size_t from, size_t to)- internally move item from one position to anothervoid push_front(const T &item)- append item to beginT &first()- equivalent offront()T &last()- equivalent ofback()