Commit 18fce17c authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot

document the interaction between insert and rehash

Summary: Document that insert may evaluate its arguments after rehashing.

Reviewed By: shixiao

Differential Revision: D10132409

fbshipit-source-id: ba5996a309ae201ae08808272edd1fb0b981cc64
parent b71b0675
......@@ -243,6 +243,14 @@ storage policies will probabilistically perform extra rehashes, which
makes it likely that reference stability problems will be found by the
address sanitizer.
An additional subtlety for hash tables that don't provide reference
stability is whether they rehash before evaluating the arguments passed
to insert(). F14 tables may rehash before evaluating the arguments
to a method that causes an insertion, so it's not safe to write
something like `map.insert(k2, map[k1])` with F14FastMap, F14ValueMap,
or F14VectorMap. This behavior matches google::dense_hash_map and the
excellent absl::flat_hash_map.
F14NodeMap does not currently support the C++17 node API, but it could
be trivially added.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment