//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // struct hash // : public unary_function // { // size_t operator()(T val) const; // }; // Not very portable #include #include #include void test(int i) { typedef std::error_code T; typedef std::hash H; static_assert((std::is_base_of, H>::value), ""); H h; T ec(i, std::system_category()); assert(h(ec) == i); } int main() { test(0); test(2); test(10); }