//===----------------------------------------------------------------------===// // // 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" void test(int i) { typedef std::error_code T; typedef std::hash H; static_assert((std::is_same::value), "" ); static_assert((std::is_same::value), "" ); H h; T ec(i, std::system_category()); const std::size_t result = h(ec); LIBCPP_ASSERT(result == static_cast(i)); ((void)result); // Prevent unused warning } int main() { test(0); test(2); test(10); }