
Read documentation for 20 minutes so apologies in advance is some of
questions are too obvious.
1) did you consider using something like std::span here? I presume answer
is yes, but you do not want to limit library to C++20 onwards.
HashAlgorithm( unsigned char const* seed, std::size_t n ); void update( void
const* data, std::size_t n );
2) From what I see there is no way for algorithm to say it only works on
aligned data, e.g. to avoid runtime check of data alignment because SIMD
instructions?
E.g
void update_aligned<32>( void const* data, std::size_t n );
Would this be too much complication for too little performance gain(not to
mention UB risk)? Not an expert, just know performance was motivation for
std::assume_aligned
https://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1007r1.pdf
3) I see there is nice trait is_contiguously_hashable trait(padding was one
of first things I wondered when reading docs), and also a documentation on
how to deal with other types, including when user provides his own hash
customization.
One thing I would ask regarding design is the following example:
std::string a; int b; // not part of the salient state void const* c;
friend bool operator==( X const& x1, X const& x2 ) { return x1.a == x2.a &&
x1.b == x2.b; } template
I'd like to request a formal review for the Hash2 library
https://github.com/pdimov/hash2 https://pdimov.github.io/hash2/
(by Christian Mazakas and myself.)
The library implements an extensible framework for implementing hashing algorithms that can support user-defined types. Its structure is largely based on the paper "Types don’t know #" by Howard Hinnant, Vinnie Falco and John Bytheway.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3980.html
We're looking for a review manager.
Comments and questions are welcome; you don't need to wait for the review.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost