// Copyright 2017, 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 #include #include template void test( R r ) { Flavor f; { T v[2] = { 1, 2 }; Hash h; hash_append( h, f, v[0] ); hash_append( h, f, v[1] ); BOOST_TEST_EQ( h.result(), r ); } { T v[2] = { 1, 2 }; Hash h; hash_append( h, f, v ); BOOST_TEST_EQ( h.result(), r ); } { std::pair v( static_cast( 1 ), static_cast( 2 ) ); Hash h; hash_append( h, f, v ); BOOST_TEST_EQ( h.result(), r ); } { boost::array v = {{ 1, 2 }}; Hash h; hash_append( h, f, v ); BOOST_TEST_EQ( h.result(), r ); } { std::array v = {{ 1, 2 }}; Hash h; hash_append( h, f, v ); BOOST_TEST_EQ( h.result(), r ); } { std::tuple v( static_cast( 1 ), static_cast( 2 ) ); Hash h; hash_append( h, f, v ); BOOST_TEST_EQ( h.result(), r ); } } int main() { using namespace boost::hash2; test( 3983810698 ); test( 3983810698 ); test( 3983810698 ); test( 3738734694 ); test( 1396319868 ); test( 1170904120 ); test( 786481930 ); return boost::report_errors(); }