#pragma once // Copyright (c) 2018-2019 David Burkett // Distributed under the MIT software license, see the accompanying // file LICENSE or http://www.opensource.org/licenses/mit-license.php. #include #include #include #include MW_NAMESPACE using Hash = BigInt<32>; END_NAMESPACE namespace std { template<> struct hash { size_t operator()(const mw::Hash& hash) const { return boost::hash_value(hash.vec()); } }; } class Hashes { public: template ::value>> static std::vector From(const std::vector& vec_hashable) noexcept { std::vector hashes; std::transform( vec_hashable.cbegin(), vec_hashable.cend(), std::back_inserter(hashes), [](const T& hashable) { return hashable.GetHash(); }); return hashes; } };