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 struct A 22 { 23 typedef short element_type; 24 typedef char difference_type; 25 }; 26 27 int main(int, char**) 28 { 29 static_assert((std::is_same<std::pointer_traits<A>::pointer, A>::value), ""); 30 static_assert((std::is_same<std::pointer_traits<int*>::pointer, int*>::value), ""); 31 32 return 0; 33 } 34