Differential D127401 Diff 435519 libcxx/test/std/containers/views/views.span/span.cons/span.dtor.compile.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/containers/views/views.span/span.cons/span.dtor.compile.pass.cpp
Show All 11 Lines | |||||
// ~span() = default; | // ~span() = default; | ||||
#include <span> | #include <span> | ||||
#include <type_traits> | #include <type_traits> | ||||
template <class T> | template <class T> | ||||
constexpr void testDestructor() { | constexpr void testDestructor() { | ||||
static_assert(std::is_nothrow_destructible_v<T>); | static_assert(std::is_nothrow_destructible_v<T>); | ||||
#ifdef _LIBCPP_ENABLE_DEBUG_MODE | |||||
static_assert(!std::is_trivially_destructible_v<T>); | |||||
#else | |||||
static_assert(std::is_trivially_destructible_v<T>); | static_assert(std::is_trivially_destructible_v<T>); | ||||
#endif | |||||
} | } | ||||
void test() { | void test() { | ||||
testDestructor<std::span<int, 1>>(); | testDestructor<std::span<int, 1>>(); | ||||
testDestructor<std::span<int>>(); | testDestructor<std::span<int>>(); | ||||
} | } |