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 <experimental/string_view>
18 template<typename CharT>
19 void test ( const CharT *s, size_t len ) {
20 typedef std::experimental::basic_string_view<CharT> SV;
23 assert ( sv1.size() == len );
24 assert ( sv1.data() == s );
27 assert ( sv1.data() == nullptr );
28 assert ( sv1.size() == 0 );
29 assert ( sv1 == SV());
33 #if _LIBCPP_STD_VER > 11
34 constexpr size_t test_ce ( size_t n ) {
35 typedef std::experimental::basic_string_view<char> SV;
36 SV sv1{ "ABCDEFGHIJKL", n };
51 #if __cplusplus >= 201103L
61 #if _LIBCPP_STD_VER > 11
62 static_assert ( test_ce (5) == 0, "" );