//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14 // REQUIRES: c++experimental // // observer_ptr // // template struct hash>; #include #include #include "poisoned_hash_helper.h" template void test_hash() { { using Ptr = std::experimental::observer_ptr; Object obj; Ptr ptr(&obj); std::hash> f; std::size_t h = f(ptr); assert(h == std::hash()(&obj)); } test_hash_enabled_for_type>(); } struct Bar {}; void test() { test_hash(); test_hash(); test_hash(); } int main(int, char**) { // Note: This isn't constexpr friendly in the spec! test(); return 0; }