1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <memory> 10 11 // template <class Ptr> 12 // struct pointer_traits 13 // { 14 // typedef Ptr pointer; 15 // ... 16 // }; 17 18 #include <memory> 19 #include <type_traits> 20 21 #include "test_macros.h" 22 23 struct A 24 { 25 typedef short element_type; 26 typedef char difference_type; 27 }; 28 main(int,char **)29int main(int, char**) 30 { 31 static_assert((std::is_same<std::pointer_traits<A>::pointer, A>::value), ""); 32 static_assert((std::is_same<std::pointer_traits<int*>::pointer, int*>::value), ""); 33 34 return 0; 35 } 36