Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cuckoo_map: allow template argument deduction
The forwarding reference `VV&&` cannot be directly deduced from a braced-init-list function parameter. This limitation makes `c.Insert(key, {2, 3, 4});` fail, although it looks completely benign (C++ standard 14.8.2.5 (5.6)). Instead one must specify the type of the value like `c.Insert<std::vector<int>>(key, {2, 3, 4});`. It is unnecessarily verbose since the value type is already known to be `V`, but the compiler does not know about the relationship between `V` and `VV`. This patch replaces the use of forwarding reference `VV&&` with two seperate copy/move references. It does make the code a bit more verbose on the library side, but not on the user side.
- Loading branch information