Yes, it is clearly defined. Suppose that if the vector is empty, begin()
is equal to end()
. Effects This inserts a copy of the element before the iterator.
Β§ Table 100 - Sequence container requirements (in addition to the container)
|------------------------------------------------------------------------------| |a.insert(p,t) | iterator Requires:T shall be CopyInsertable into X. For | | | vector and deque, T shall also be CopyAssignable.| | | Effects: Inserts a copy of t before p. | -------------------------------------------------------------------------------|
also see: std :: vector :: insert
billz source share