]>
Commit | Line | Data |
---|---|---|
52066eae | 1 | // { dg-do run { target c++11 } } |
e16a69a8 TS |
2 | |
3 | // | |
818ab71a | 4 | // Copyright (C) 2014-2016 Free Software Foundation, Inc. |
e16a69a8 TS |
5 | // |
6 | // This file is part of the GNU ISO C++ Library. This library is free | |
7 | // software; you can redistribute it and/or modify it under the | |
8 | // terms of the GNU General Public License as published by the | |
9 | // Free Software Foundation; either version 3, or (at your option) | |
10 | // any later version. | |
11 | // | |
12 | // This library is distributed in the hope that it will be useful, | |
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | // GNU General Public License for more details. | |
16 | // | |
17 | // You should have received a copy of the GNU General Public License along | |
18 | // with this library; see the file COPYING3. If not see | |
19 | // <http://www.gnu.org/licenses/>. | |
20 | ||
21 | // 28.12.2 Class template regex_token_iterator | |
22 | ||
23 | #include <regex> | |
24 | #include <testsuite_hooks.h> | |
25 | ||
26 | void | |
27 | test01() | |
28 | { | |
29 | bool test __attribute__((unused)) = true; | |
30 | ||
31 | const std::string s(" 111 222 "); | |
32 | const std::regex re("\\w+"); | |
33 | ||
34 | std::sregex_token_iterator it1(s.begin(), s.end(), re), it2(it1), end; | |
35 | ||
36 | for (; it1 != end; ++it1, ++it2) { | |
37 | VERIFY(it1 == it2); | |
38 | VERIFY(*it1 == *it2); | |
39 | } | |
40 | VERIFY(it2 == end); | |
41 | } | |
42 | ||
43 | int | |
44 | main() | |
45 | { | |
46 | test01(); | |
47 | return 0; | |
48 | } |