1 /* tests for using boost::hash with boost::array
2 * (C) Copyright Marshall Clow 2012
3 * Distributed under the Boost Software License, Version 1.0. (See
4 * accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/array.hpp>
12 #include <boost/functional/hash.hpp>
14 #define BOOST_TEST_MAIN
15 #include <boost/test/unit_test.hpp>
22 // std::size_t hash0 = boost::hash<boost::array<T,0> > () ( boost::array<T, 0> ());
23 // std::size_t hash1 = boost::hash<boost::array<T,1> > () ( boost::array<T, 1> ());
25 typedef boost::array< T, 5 > barr;
27 barr test_barr = {{ 1, 1, 2, 3, 5 }};
28 arr test_arr = { 1, 1, 2, 3, 5 };
30 std::size_t bhash = boost::hash<barr> () ( test_barr );
31 std::size_t ahash = boost::hash<arr> () ( test_arr );
32 BOOST_CHECK ( ahash == bhash );
37 BOOST_AUTO_TEST_CASE( test_main )
41 RunTests< long double >();