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 | |
Dan Albert | b4ed5ca | 2014-08-04 18:44:48 +0000 | [diff] [blame] | 11 | // REQUIRES: locale.cs_CZ.ISO8859-2 |
| 12 | |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 13 | // <regex> |
| 14 | |
| 15 | // template <class charT> struct regex_traits; |
| 16 | |
| 17 | // template <class ForwardIterator> |
| 18 | // string_type transform(ForwardIterator first, ForwardIterator last) const; |
| 19 | |
| 20 | #include <regex> |
| 21 | #include <cassert> |
Marshall Clow | 83e2c4d | 2013-01-05 03:21:01 +0000 | [diff] [blame] | 22 | #include "test_iterators.h" |
Dan Albert | 1d4a1ed | 2016-05-25 22:36:09 -0700 | [diff] [blame^] | 23 | |
Ed Schouten | eda3fca | 2015-03-16 15:09:15 +0000 | [diff] [blame] | 24 | #include "platform_support.h" // locale name macros |
| 25 | |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 26 | int main() |
| 27 | { |
| 28 | { |
| 29 | std::regex_traits<char> t; |
| 30 | const char a[] = "a"; |
| 31 | const char B[] = "B"; |
| 32 | typedef forward_iterator<const char*> F; |
| 33 | assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1))); |
Ed Schouten | eda3fca | 2015-03-16 15:09:15 +0000 | [diff] [blame] | 34 | t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2)); |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 35 | assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1))); |
| 36 | } |
| 37 | { |
| 38 | std::regex_traits<wchar_t> t; |
| 39 | const wchar_t a[] = L"a"; |
| 40 | const wchar_t B[] = L"B"; |
| 41 | typedef forward_iterator<const wchar_t*> F; |
| 42 | assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1))); |
Ed Schouten | eda3fca | 2015-03-16 15:09:15 +0000 | [diff] [blame] | 43 | t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2)); |
Howard Hinnant | 3257c98 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 44 | assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1))); |
| 45 | } |
| 46 | } |