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 // UNSUPPORTED: c++98, c++03 11 12 // <utility> 13 14 // template <class T1, class T2> struct pair 15 16 // ~pair() 17 18 // C++17 added: 19 // The destructor of pair shall be a trivial destructor 20 // if (is_trivially_destructible_v<T1> && is_trivially_destructible_v<T2>) is true. 21 22 23 #include <utility> 24 #include <type_traits> 25 #include <string> 26 #include <cassert> 27 28 #include "test_macros.h" 29 main()30int main() 31 { 32 static_assert((std::is_trivially_destructible< 33 std::pair<int, float> >::value), ""); 34 static_assert((!std::is_trivially_destructible< 35 std::pair<int, std::string> >::value), ""); 36 } 37