libcruft-util/hash/mix.hpp

23 lines
532 B
C++
Raw Normal View History

#pragma once
#include "../hash.hpp"
#include <utility>
namespace cruft::hash {
/// A std compatible adapter for a variadic 'mix' hash.
///
/// It combines multiple values in a way that is unlikely to result in collisions.
///
/// The exact implementation is not defined.
struct mixer {
template <typename ...ValueT>
auto operator () (ValueT &&...elements)
{
return cruft::hash::mix (
std::forward<ValueT> (elements)...
);
}
};
}