
10 Dec
2024
10 Dec
'24
12:34 a.m.
Zach Laine wrote:
Naively, I would have reduced them to:
struct unordered_tag {};
template
constexpr void hash_append( Hash& h, Flavor const& f, T const& v ); template
constexpr void hash_append( Hash& h, Flavor const& f, It first, It last ); template
constexpr void hash_append( Hash& h, Flavor const& f, It first, It last, unordered_tag ); Is there a reason that could not work?
There is, yes. Naming everything hash_append doesn't play well with making hash_append variadic, as has already been suggested a few times. Once you have that, the above overload set becomes a nice trap because hash_append( h, f, "foo", "bar" ); calls the iterator overload.