1 // -*- C++ -*- 2 //===----------------------------------------------------------------------===// 3 // 4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 // See https://llvm.org/LICENSE.txt for license information. 6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <regex> 11 12 // template <class charT> struct regex_traits; 13 14 // static std::size_t length(const char_type* p); 15 16 #include <regex> 17 #include <cassert> 18 #include "test_macros.h" 19 main(int,char **)20int main(int, char**) 21 { 22 assert(std::regex_traits<char>::length("") == 0); 23 assert(std::regex_traits<char>::length("1") == 1); 24 assert(std::regex_traits<char>::length("12") == 2); 25 assert(std::regex_traits<char>::length("123") == 3); 26 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); 31 32 return 0; 33 } 34