boostorg / unordered

Boost.org unordered module
http://boost.org/libs/unordered
Boost Software License 1.0
62 stars 55 forks source link

Requirements on keys for bulk visitation are overly restrictive #263

Open joaquintides opened 1 month ago

joaquintides commented 1 month ago

Currently, bulk visitation requires that

[f]or K = std::iterator_traits::value_type, either K [be] key_type or else Hash::is_transparent and Pred::is_transparent [be] valid member typedefs.

This precludes the scenario where the keys are implicitly convertible to key_type, which seems to be overly restrictive. The drawback of allowing this is that conversion from std::iterator_traits<FwdIterator>::value_type to key_type will happen more than once for each key (twice, to be precise).