|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-12-06 12:09:30
Alexander Grund wrote:
> As far as I understood this is exactly how the library is implemented:
> It is not `boost::hash2::update( h, span )` but `boost::hash2::hash_append( h,
> {}, span )` but thats minor.
Not quite, because hash_append would add the size in this case. The
equivalent is hash_append_range, but it's old school and takes two
iterators. Maybe I need to add an overload of hash_append_range
that actually takes a range.
Incidentally, hash_append_range is what you already have to use if
you invoke the hash algorithm at compile time on e.g. char[], because
void* and reinterpret_cast don't work in constexpr. See the second
example in
https://pdimov.github.io/hash2/doc/html/hash2.html#example_compile_time_hashing
Calling either `update` won't work in this case.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk