unordered_multimap::rehash

unordered_multimap::rehash (재해싱)

rehash()는 버킷 수를 count 이상이면서 size() / max_load_factor() 이상인 값 n으로 바꾸고 컨테이너를 재해싱해요.

출처: cppreference

본문

rehash는 버킷 수를 count보다 작지 않고 size() / max_load_factor()를 충족하는 값으로 변경한 뒤, 새 버킷 수에 맞게 요소를 재배치해요.

void rehash( size_type count );

복잡도 (Complexity)

평균적으로 컨테이너 크기에 선형, 최악의 경우 이차 시간이에요.

참고 (Notes)

rehash(0)은 임시로 max_load_factor()를 키워 자동 재해싱을 중단한 뒤 다시 강제 재해싱을 할 때 쓸 수 있어요.

더 알아보기 (Learn more)

cppreference