#include "hash/tuple.hpp" #include "tap.hpp" #include // A "hash" that returns the argument's size. struct size_hash { template std::size_t operator () (ValueT const &val) const { return std::size (val); } }; // A 'mix' function that just sums the arguments. struct sum_mix { template std::size_t operator () (ValueT ...val) const { return (val + ...); } }; int main () { using namespace std::string_view_literals; cruft::hash::tuple h; cruft::TAP::logger tap; tap.expect_eq ( h ( std::make_tuple ( "foo"sv, std::vector (5) ) ), 8u, "size/sum tuple hash" ); return tap.status (); }