summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp
blob: 6a22864b23f107caf1b45018e976327b62235255 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// P2251 was voted into C++23, but is supported even in C++17 mode by all vendors.

// <string_view>

#include <string_view>
#include <type_traits>

#include "test_macros.h"

static_assert(std::is_trivially_copyable<std::basic_string_view<char> >::value, "");
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
static_assert(std::is_trivially_copyable<std::basic_string_view<wchar_t> >::value, "");
#endif
#ifndef _LIBCPP_HAS_NO_CHAR8_T
static_assert(std::is_trivially_copyable<std::basic_string_view<char8_t> >::value, "");
#endif
static_assert(std::is_trivially_copyable<std::basic_string_view<char16_t> >::value, "");
static_assert(std::is_trivially_copyable<std::basic_string_view<char32_t> >::value, "");