//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct hash // : public unary_function // { // size_t operator()(T val) const; // }; #include #include #include #include "test_macros.h" template void test() { typedef std::bitset T; typedef std::hash H; static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); ASSERT_NOEXCEPT(H()(T())); H h; T bs(static_cast(N)); const std::size_t result = h(bs); LIBCPP_ASSERT(result == N); ((void)result); // Prevent unused warning } int main() { test<0>(); test<10>(); test<100>(); test<1000>(); }