1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <memory> 11 12 // template <class X> 13 // class auto_ptr 14 // { 15 // public: 16 // typedef X element_type; 17 // ... 18 // }; 19 20 // REQUIRES: c++98 || c++03 || c++11 || c++14 21 22 #include <memory> 23 #include <type_traits> 24 25 template <class T> 26 void 27 test() 28 { 29 static_assert((std::is_same<typename std::auto_ptr<T>::element_type, T>::value), ""); 30 std::auto_ptr<T> p; 31 ((void)p); 32 } 33 34 int main() 35 { 36 test<int>(); 37 test<double>(); 38 test<void>(); 39 } 40