SNVector
|
SNVector (int num=2) | |
constructor More... | |
SNVector (T *arr, int n) | |
constructor More... | |
SNVector (const SNVector &vector) | |
copy constructor More... | |
~SNVector () | |
Destructor. More... | |
SNVector & | operator= (const SNVector &vector) |
copy assignment More... | |
SNVector & | operator= (SNVector &&vector) noexcept |
move assignment More... | |
T & | operator[] (int) |
overloading random access operator to access SNVector items by reference More... | |
int | push_back (T) |
add item in the end of SNVector More... | |
T | pop_back () |
to delete the last item in SNVector More... | |
void | erase (iterator) |
to delete item at certain index from SNVector More... | |
void | erase (iterator1, iterator2) |
to delete range of items from SNVector More... | |
void | clear () |
Delete all SNVector content. More... | |
void | insert (iterator, T item) |
to insert item of type Template in certain index More... | |
iterator | begin () |
Getter of address to the first item. More... | |
iterator | end () |
Getter of address to the last item. More... | |
bool | operator== (const SNVector< T > &vector) |
overloading of the comparing operator More... | |
bool | operator< (const SNVector< T > &vector) |
overloading to the less than operator, Compares item by item More... | |
int | Size () |
Size Getter. More... | |
int | Capacity () |
Capacity Getter. More... | |
int | resize () |
Relocate to bigger space. More... | |
bool | empty () |
chech the size of the SNVector More... | |
typedef T * | iterator |
typedef T * | iterator1 |
typedef T * | iterator2 |
int | size |
int | capacity |
T * | vec |
ostream & | operator (ostream &out, SNVector< T > vector) |
◆ SNVector() [1/3]
SNVector< T >::SNVector | ( | int | num = 2 | ) |
constructor
- Template Parameters
-
T
- Parameters
-
num
◆ SNVector() [2/3]
SNVector< T >::SNVector | ( | T * | arr, |
int | n | ||
) |
constructor
- Template Parameters
-
T
- Parameters
-
arr n
◆ SNVector() [3/3]
SNVector< T >::SNVector | ( | const SNVector< T > & | vector | ) |
copy constructor
- Template Parameters
-
T
- Parameters
-
vector
◆ ~SNVector()
◆ begin()
T * SNVector< T >::begin |
Getter of address to the first item.
- Template Parameters
-
T
- Returns
- pointer to the first item in SNVector
◆ Capacity()
int SNVector< T >::Capacity |
◆ clear()
◆ empty()
bool SNVector< T >::empty |
◆ end()
T * SNVector< T >::end |
Getter of address to the last item.
- Template Parameters
-
T
- Returns
- pointer to the first item in SNVector
◆ erase() [1/2]
void SNVector< T >::erase | ( | iterator | iter | ) |
to delete item at certain index from SNVector
- Template Parameters
-
T
- Parameters
-
iter pointer to the address we want to delete
◆ erase() [2/2]
void SNVector< T >::erase | ( | iterator1 | i1, |
iterator2 | i2 | ||
) |
to delete range of items from SNVector
- Template Parameters
-
T
- Parameters
-
i1 the lower boundary of the range i2 the upper boundary of the range
◆ insert()
void SNVector< T >::insert | ( | iterator | iter, |
T | item | ||
) |
to insert item of type Template in certain index
- Template Parameters
-
T
- Parameters
-
iter pointer to the index to insert in item of type Template to insert in SNVector
◆ operator<()
overloading to the less than operator, Compares item by item
- Template Parameters
-
T
- Parameters
-
vector
- Returns
- true if first different item in this is < in other
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
overloading of the comparing operator
- Template Parameters
-
T
- Parameters
-
vector
- Returns
- true if ==
◆ operator[]()
T & SNVector< T >::operator[] | ( | int | index | ) |
overloading random access operator to access SNVector items by reference
- Template Parameters
-
T
- Parameters
-
index
- Returns
- the item accessed of Template type
◆ pop_back()
T SNVector< T >::pop_back |
◆ push_back()
int SNVector< T >::push_back | ( | T | item | ) |
add item in the end of SNVector
- Template Parameters
-
T
- Parameters
-
item
- Returns
- the new size of the vector
◆ resize()
int SNVector< T >::resize |