brintos

brintos / llvm-project-archived public Read only

0
0
Text · 967 B · f19bce8 Raw
38 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++0310 11// <utility>12 13// template <class T1, class T2> struct pair14 15// ~pair()16 17// C++17 added:18//   The destructor of pair shall be a trivial destructor19//     if (is_trivially_destructible_v<T1> && is_trivially_destructible_v<T2>) is true.20 21 22#include <utility>23#include <type_traits>24#include <string>25#include <cassert>26 27#include "test_macros.h"28 29int main(int, char**)30{31  static_assert((std::is_trivially_destructible<32      std::pair<int, float> >::value), "");33  static_assert((!std::is_trivially_destructible<34      std::pair<int, std::string> >::value), "");35 36  return 0;37}38