xtd 0.2.0
Loading...
Searching...
No Matches

◆ insert() [1/6]

template<typename type_t , typename allocator_t = xtd::collections::generic::helpers::allocator<typename std::conditional<std::is_same<bool, type_t>::value, char, type_t>::type>>
virtual iterator xtd::collections::generic::list< type_t, allocator_t >::insert ( const_iterator  pos,
const type_t &  value 
)
inlinevirtual

Inserts elements at the specified location in the container.

Parameters
posthe iterator before which the content will be inserted (pos may be the end() iterator).
valueThe element value to insert.
Returns
The iterator pointing to the inserted value.
Remarks
Inserts value before pos.
If after the operation the new xtd::collections::generic::list::size() is greater than old xtd::collections::generic::list::capacity() a reallocation takes place, in which case all iterators (including the xtd::collections::generic::list::end() iterator) and all references to the elements are invalidated. Otherwise, only the iterators and references before the insertion point remain valid.