// Copyright 2024 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #include #include #include template class hash { public: std::size_t operator()( T const& v ) const { H h; boost::hash2::hash_append( h, {}, v ); return boost::hash2::get_integral_result( h.result() ); } }; int main() { using hasher = hash; boost::unordered_flat_map map; map[ "foo" ] = 1; map[ "bar" ] = 2; }