vector::shrink_to_fit

vector::shrink_to_fit (여유 용량 제거)

shrink_to_fit()은 사용하지 않는 용량의 제거를 요청해요. capacity()size()로 줄이려는 비구속적 요청이에요.

출처: cppreference

본문

shrink_to_fitstd::vector의 용량을 크기에 맞게 줄이려는 요청이에요. 구현에 따라 실제로 줄어들지 않을 수도 있는 비구속적(non-binding) 요청이에요.

void shrink_to_fit();

반환값 (Return value)

없음.

복잡도 (Complexity)

컨테이너 크기에 선형일 수 있어요.

더 알아보기 (Learn more)

cppreference