std::unordered_map and std::vector both have the reserve method, which increases the capacity of the collection so that it would be possible to add multiple elements to the collection without enlarging the internal buffer. However, std::vector also has a method capacity() that returns the current capacity of the collection. std::unordered_map does not have such a method. Is there any way to obtain the capacity of std::unordered_map using whatever the class already provides?