vector::insert

vector::insert (요소 삽입)

insert()는 지정한 위치에 요소나 요소 범위를 삽입해요.

출처: cppreference

본문

insert는 지정한 위치 pos에 요소를 삽입해요. 여러 오버로드가 있어서 단일 값, 개수+값, 반복자 범위를 넣을 수 있어요.

iterator insert( const_iterator pos, const T& value );

삽입 후의 size()capacity()를 넘으면 재할당이 발생해요.

반환값 (Return value)

삽입된 첫 번째 요소를 가리키는 반복자예요.

복잡도 (Complexity)

삽입 위치와 요소 수에 따라 선형 시간이에요.

더 알아보기 (Learn more)

cppreference