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 // void clear() noexcept
15 #include <string_view>
18 #include "test_macros.h"
20 template<typename CharT>
21 void test ( const CharT *s, size_t len ) {
22 typedef std::basic_string_view<CharT> SV;
25 assert ( sv1.size() == len );
26 assert ( sv1.data() == s );
29 assert ( sv1.data() == nullptr );
30 assert ( sv1.size() == 0 );
31 assert ( sv1 == SV());
36 constexpr size_t test_ce ( size_t n ) {
37 typedef std::basic_string_view<char> SV;
38 SV sv1{ "ABCDEFGHIJKL", n };
53 #if TEST_STD_VER >= 11
64 static_assert ( test_ce (5) == 0, "" );