//===----------------------------------------------------------------------===// // // 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 pointer_traits // { // static pointer pointer_to(
); // constexpr in C++20 // ... // }; #include #include #include "test_macros.h" #if TEST_STD_VER > 17 constexpr #endif bool check() { { int i = 0; static_assert((std::is_same::pointer_to(i))>::value), ""); int* a = std::pointer_traits::pointer_to(i); assert(a == &i); } { (std::pointer_traits::element_type)0; } return true; } int main() { check(); #if TEST_STD_VER > 17 static_assert(check(), ""); #endif }