Fichas
Vector
Fichas del conjunto (23)
- 1**VECTOR**.begin()return an iterator to the beginning of vector list
- 2**VECTOR**.end()return an iterator to the end of vector list
- 3std::vector::iterator sample = **VECTOR**.begin()create iterator variable and set value for vector list position
- 4**VECTOR**[i]Access Element at (i) the unsafe method
- 5**VECTOR**.at(i)Access Element of Vector with bounds checking
- 6**VECTOR**.front()access first element of vector list
- 7**VECTOR**.back()access last item of list
- 8**VECTOR**.data()access data **incomplete definition**
- 9**VECTOR**.assign() (elements, value) (adjVectorPosi1,adjVectorPos2) *iteratorslets you assign without pushback as if when first declaring the vector
- 10**VECTOR**.push_back()adds element to end of vector
construct temp obj(copy) then moved to end of vector - 11**VECTOR**.pop_back()deletes element at the end of vector list
- 12**VECTOR**.insert() (**VECTOR**.begin()) (**VECTOR**.begin(), pos1, pos2)insert element before position defined
with optional param. overloading copy between to positions in different vector - 13**VECTOR**.erase() (nthElement) (nth, mthElement)delete an item from vector
at specified
or range of nth -> m'th Elements - 14**VECTOR**.swap(**VECTOR2**)swap entire vector contents
- 15**VECTOR**.clear()resets to an empty vector
- 16**VECTOR**.emplace(iterator, value)forward the value and construct in place no copies no moves
- 17**VECTOR**.emplace_back()forward and construct in place at end of vector no copy or moving
- 18**VECTOR**.size()returns integer with number of elements
- 19**VECTOR**.max_size()returns integer with max memory allocation possible *not max element size
- 20vector **VECTOR** () (**VECTOR2**) (#, value) (iteraStart,iteraEnd) {1,2,3,4}vector declaration with parameter overload syntax
- 21**VECTOR**.resize(intValue)size the container manually
- 22**VECTOR**.capacity()returns max amount of potential element storage without resizing
- 23**VECTOR**.empty()bool function checking for empty vector
Información
- Descripción
- Vector syntax, functions, and access members
- Creado por
- Ariel Sanchez
- Visitas
- 92
- Etiquetas
- Valoración