[libc++] Prepare string.{contains, ends_with, iterators, require, starts_with} tests for constexpr
Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D119304
This commit is contained in:
parent
f97795121f
commit
c515b652a0
|
@ -35,7 +35,10 @@ void test()
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
test();
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,10 @@ void test()
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
test();
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,10 @@ void test()
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
test();
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
S s1 {};
|
S s1 {};
|
||||||
S s2 { "abcde", 5 };
|
S s2 { "abcde", 5 };
|
||||||
|
@ -29,7 +28,17 @@ int main(int, char**)
|
||||||
assert (!s1.ends_with('x'));
|
assert (!s1.ends_with('x'));
|
||||||
assert ( s2.ends_with('e'));
|
assert ( s2.ends_with('e'));
|
||||||
assert (!s2.ends_with('x'));
|
assert (!s2.ends_with('x'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
const char *s = "abcde";
|
const char *s = "abcde";
|
||||||
|
|
||||||
|
@ -58,7 +57,16 @@ int main(int, char**)
|
||||||
assert (!sNot.ends_with("bcde"));
|
assert (!sNot.ends_with("bcde"));
|
||||||
assert (!sNot.ends_with("abcde"));
|
assert (!sNot.ends_with("abcde"));
|
||||||
assert ( sNot.ends_with("def"));
|
assert ( sNot.ends_with("def"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**) {
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
typedef std::string_view SV;
|
typedef std::string_view SV;
|
||||||
const char *s = "abcde";
|
const char *s = "abcde";
|
||||||
|
@ -67,7 +66,16 @@ int main(int, char**)
|
||||||
assert (!sNot.ends_with(sv4));
|
assert (!sNot.ends_with(sv4));
|
||||||
assert (!sNot.ends_with(sv5));
|
assert (!sNot.ends_with(sv5));
|
||||||
assert ( sNot.ends_with(svNot));
|
assert ( sNot.ends_with(svNot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**) {
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
void
|
TEST_CONSTEXPR_CXX20 void
|
||||||
test(S s)
|
test(S s)
|
||||||
{
|
{
|
||||||
const S& cs = s;
|
const S& cs = s;
|
||||||
|
@ -31,19 +31,28 @@ test(S s)
|
||||||
assert(b == cb);
|
assert(b == cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
void
|
TEST_CONSTEXPR_CXX20 void
|
||||||
test(const S& s)
|
test(const S& s)
|
||||||
{
|
{
|
||||||
typename S::const_iterator cb = s.cbegin();
|
typename S::const_iterator cb = s.cbegin();
|
||||||
|
@ -28,19 +28,28 @@ test(const S& s)
|
||||||
assert(cb == s.begin());
|
assert(cb == s.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -24,20 +24,28 @@ test(const S& s)
|
||||||
assert(ce == s.end());
|
assert(ce == s.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
void
|
TEST_CONSTEXPR_CXX20 void
|
||||||
test(const S& s)
|
test(const S& s)
|
||||||
{
|
{
|
||||||
typename S::const_reverse_iterator cb = s.crbegin();
|
typename S::const_reverse_iterator cb = s.crbegin();
|
||||||
|
@ -28,19 +28,28 @@ test(const S& s)
|
||||||
assert(cb == s.rbegin());
|
assert(cb == s.rbegin());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -17,26 +17,35 @@
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
void
|
TEST_CONSTEXPR_CXX20 void
|
||||||
test(const S& s)
|
test(const S& s)
|
||||||
{
|
{
|
||||||
typename S::const_reverse_iterator ce = s.crend();
|
typename S::const_reverse_iterator ce = s.crend();
|
||||||
assert(ce == s.rend());
|
assert(ce == s.rend());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
void
|
TEST_CONSTEXPR_CXX20 void
|
||||||
test(S s)
|
test(S s)
|
||||||
{
|
{
|
||||||
const S& cs = s;
|
const S& cs = s;
|
||||||
|
@ -34,19 +34,28 @@ test(S s)
|
||||||
assert(static_cast<std::size_t>(ce - cs.begin()) == cs.size());
|
assert(static_cast<std::size_t>(ce - cs.begin()) == cs.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
void
|
TEST_CONSTEXPR_CXX20 void
|
||||||
test(S s)
|
test(S s)
|
||||||
{
|
{
|
||||||
const S& cs = s;
|
const S& cs = s;
|
||||||
|
@ -31,19 +31,28 @@ test(S s)
|
||||||
assert(b == cb);
|
assert(b == cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -34,19 +34,28 @@ test(S s)
|
||||||
assert(static_cast<std::size_t>(ce - cs.rbegin()) == cs.size());
|
assert(static_cast<std::size_t>(ce - cs.rbegin()) == cs.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||||
test(S());
|
test(S());
|
||||||
test(S("123"));
|
test(S("123"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -25,30 +25,39 @@ void test_contiguous ( const C &c )
|
||||||
assert ( *(c.begin() + static_cast<typename C::difference_type>(i)) == *(std::addressof(*c.begin()) + i));
|
assert ( *(c.begin() + static_cast<typename C::difference_type>(i)) == *(std::addressof(*c.begin()) + i));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
test_contiguous(S());
|
test_contiguous(S());
|
||||||
test_contiguous(S("1"));
|
test_contiguous(S("1"));
|
||||||
test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890"));
|
test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890"));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
typedef test_allocator<char> A;
|
typedef test_allocator<char> A;
|
||||||
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
||||||
test_contiguous(S(A(3)));
|
test_contiguous(S(A(3)));
|
||||||
test_contiguous(S("1", A(5)));
|
test_contiguous(S("1", A(5)));
|
||||||
test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)));
|
test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)));
|
||||||
}
|
}
|
||||||
#if TEST_STD_VER >= 11
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
typedef min_allocator<char> A;
|
typedef min_allocator<char> A;
|
||||||
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
typedef std::basic_string<char, std::char_traits<char>, A> S;
|
||||||
test_contiguous(S(A{}));
|
test_contiguous(S(A{}));
|
||||||
test_contiguous(S("1", A()));
|
test_contiguous(S("1", A()));
|
||||||
test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890", A()));
|
test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890", A()));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
S s1 {};
|
S s1 {};
|
||||||
S s2 { "abcde", 5 };
|
S s2 { "abcde", 5 };
|
||||||
|
@ -29,7 +28,17 @@ int main(int, char**)
|
||||||
assert (!s1.starts_with('x'));
|
assert (!s1.starts_with('x'));
|
||||||
assert ( s2.starts_with('a'));
|
assert ( s2.starts_with('a'));
|
||||||
assert (!s2.starts_with('x'));
|
assert (!s2.starts_with('x'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
{
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
const char *s = "abcde";
|
const char *s = "abcde";
|
||||||
S s0 {};
|
S s0 {};
|
||||||
|
@ -57,7 +56,17 @@ int main(int, char**)
|
||||||
assert (!sNot.starts_with("abcd"));
|
assert (!sNot.starts_with("abcd"));
|
||||||
assert (!sNot.starts_with("abcde"));
|
assert (!sNot.starts_with("abcde"));
|
||||||
assert ( sNot.starts_with("def"));
|
assert ( sNot.starts_with("def"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
int main(int, char**)
|
bool test() {
|
||||||
{
|
|
||||||
{
|
|
||||||
typedef std::string S;
|
typedef std::string S;
|
||||||
typedef std::string_view SV;
|
typedef std::string_view SV;
|
||||||
const char *s = "abcde";
|
const char *s = "abcde";
|
||||||
|
@ -67,7 +65,16 @@ int main(int, char**)
|
||||||
assert (!sNot.starts_with(sv4));
|
assert (!sNot.starts_with(sv4));
|
||||||
assert (!sNot.starts_with(sv5));
|
assert (!sNot.starts_with(sv5));
|
||||||
assert ( sNot.starts_with(svNot));
|
assert ( sNot.starts_with(svNot));
|
||||||
}
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
#if TEST_STD_VER > 17
|
||||||
|
// static_assert(test());
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue