Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Howard Hinnant | 0ce0224 | 2010-09-28 17:19:10 +0000 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 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> |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 19 | |
| 20 | int main() |
| 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 | } |