1 //===----------------------------------------------------------------------===//
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-exception
7 //===----------------------------------------------------------------------===//
8 // UNSUPPORTED: c++03, c++11, c++14, c++17
12 // constexpr bool starts_with(charT x) const noexcept;
17 #include "test_macros.h"
20 constexpr void test_string() {
24 ASSERT_NOEXCEPT(s1
.starts_with('e'));
26 assert(!s1
.starts_with('a'));
27 assert(!s1
.starts_with('x'));
28 assert(s2
.starts_with('a'));
29 assert(!s2
.starts_with('x'));
32 constexpr bool test() {
33 test_string
<std::string
>();
38 int main(int, char**) {
40 static_assert(test());