1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 
11 // <regex>
12 
13 // template <class charT> struct regex_traits;
14 
15 // static std::size_t length(const char_type* p);
16 
17 #include <regex>
18 #include <cassert>
19 #include "test_macros.h"
20 
main()21 int main()
22 {
23     assert(std::regex_traits<char>::length("") == 0);
24     assert(std::regex_traits<char>::length("1") == 1);
25     assert(std::regex_traits<char>::length("12") == 2);
26     assert(std::regex_traits<char>::length("123") == 3);
27 
28     assert(std::regex_traits<wchar_t>::length(L"") == 0);
29     assert(std::regex_traits<wchar_t>::length(L"1") == 1);
30     assert(std::regex_traits<wchar_t>::length(L"12") == 2);
31     assert(std::regex_traits<wchar_t>::length(L"123") == 3);
32 }
33