1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
13 // constexpr const _CharT* data() const noexcept;
15 #include <string_view>
18 #include "test_macros.h"
20 template <typename CharT>
21 void test ( const CharT *s, size_t len ) {
22 std::basic_string_view<CharT> sv ( s, len );
23 assert ( sv.length() == len );
24 assert ( sv.data() == s );
34 #if TEST_STD_VER >= 11
44 constexpr const char *s = "ABC";
45 constexpr std::basic_string_view<char> sv( s, 2 );
46 static_assert( sv.length() == 2, "" );
47 static_assert( sv.data() == s, "" );