I have an unordered_multimap and I insert elements which have the same key many times, so some of them should go in the same bucket. I insert exactly 10000 elements. But for some reason when I print the bucket_count() it is 12983. This makes no sense to me, unless there was a small max_load_factor, but I printed it and it seems to be set to 1.0 by default, while the load_factor is about 0.7-0.8 after I insert everything. Anyone know why it works like that? Isn't that inefficient? I could have less buckets than the number of elements I insert.
Aucun commentaire:
Enregistrer un commentaire