// Copyright John Maddock 2015. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #ifdef _MSC_VER #define _SCL_SECURE_NO_WARNINGS #endif #include #include #include #include #include #ifdef TEST_FLOAT128 #include #endif #ifdef TEST_GMP #include #endif #ifdef TEST_MPFR #include #endif #ifdef TEST_MPFI #include #endif #ifdef TEST_TOMMATH #include #endif #include #include "test.hpp" #include #include template void test() { T val = 23; std::size_t t1 = boost::hash()(val); BOOST_CHECK(t1); #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL std::size_t t2 = std::hash()(val); BOOST_CHECK_EQUAL(t1, t2); #endif val = -23; std::size_t t3 = boost::hash()(val); BOOST_CHECK_NE(t1, t3); #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL t2 = std::hash()(val); BOOST_CHECK_EQUAL(t3, t2); #endif } int main() { test(); test(); //test(); test > >(); test(); test(); test(); test > >(); test > >(); #ifdef TEST_FLOAT128 test(); #endif #ifdef TEST_GMP test(); test(); test(); #endif #ifdef TEST_MPFR test(); #endif #ifdef TEST_MPFI test(); #endif #ifdef TEST_TOMMATH test(); test(); #endif return boost::report_errors(); }