//===----------------------------------------------------------------------===// // // 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; // }; // Not very portable #include #include #include #include "min_allocator.h" int main() { { typedef std::vector T; typedef std::hash H; static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); ASSERT_NOEXCEPT(H()(T())); bool ba[] = {true, false, true, true, false}; T vb(std::begin(ba), std::end(ba)); H h; assert(h(vb) != 0); } #if TEST_STD_VER >= 11 { typedef std::vector> T; typedef std::hash H; static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); ASSERT_NOEXCEPT(H()(T())); bool ba[] = {true, false, true, true, false}; T vb(std::begin(ba), std::end(ba)); H h; assert(h(vb) != 0); } #endif }