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 //===----------------------------------------------------------------------===//
11 // template <class charT> struct regex_traits;
13 // static std::size_t length(const char_type* p);
17 #include "test_macros.h"
21 assert(std::regex_traits
<char>::length("") == 0);
22 assert(std::regex_traits
<char>::length("1") == 1);
23 assert(std::regex_traits
<char>::length("12") == 2);
24 assert(std::regex_traits
<char>::length("123") == 3);
26 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
27 assert(std::regex_traits
<wchar_t>::length(L
"") == 0);
28 assert(std::regex_traits
<wchar_t>::length(L
"1") == 1);
29 assert(std::regex_traits
<wchar_t>::length(L
"12") == 2);
30 assert(std::regex_traits
<wchar_t>::length(L
"123") == 3);