Though the docs say this should be num_buckets, I think it's much more useful as num_elements. As a special feature, calling with req_elements==0 will cause us to shrink if we can, saving space. -----------------------------------------------------------------
| 2840 | // req_elements==0 will cause us to shrink if we can, saving space. |
| 2841 | // ----------------------------------------------------------------- |
| 2842 | void resize(size_type req_elements) |
| 2843 | { |
| 2844 | // resize to this or larger |
| 2845 | if (settings.consider_shrink() || req_elements == 0) |
| 2846 | _maybe_shrink(); |
| 2847 | if (req_elements > table.num_nonempty()) // we only grow |
| 2848 | _resize_delta((size_type)(req_elements - table.num_nonempty())); |
| 2849 | } |
| 2850 | |
| 2851 | // Get and change the value of shrink_factor and enlarge_factor. The |
| 2852 | // description at the beginning of this file explains how to choose |
nothing calls this directly
no test coverage detected