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 #include <boost/core/lightweight_test_trait.hpp>
21 // std::size_t hash0 = boost::hash<boost::array<T,0> > () ( boost::array<T, 0> ());
22 // std::size_t hash1 = boost::hash<boost::array<T,1> > () ( boost::array<T, 1> ());
24 typedef boost::array< T, 5 > barr;
26 barr test_barr = {{ 1, 1, 2, 3, 5 }};
27 arr test_arr = { 1, 1, 2, 3, 5 };
29 std::size_t bhash = boost::hash<barr> () ( test_barr );
30 std::size_t ahash = boost::hash<arr> () ( test_arr );
31 BOOST_TEST ( ahash == bhash );
40 RunTests< long double >();
42 return boost::report_errors();