]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/28_regex/iterators/regex_token_iterator/64303.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 28_regex / iterators / regex_token_iterator / 64303.cc
CommitLineData
52066eae 1// { dg-do run { target c++11 } }
e16a69a8
TS
2
3//
cbe34bb5 4// Copyright (C) 2014-2017 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
26void
27test01()
28{
e16a69a8
TS
29 const std::string s(" 111 222 ");
30 const std::regex re("\\w+");
31
32 std::sregex_token_iterator it1(s.begin(), s.end(), re), it2(it1), end;
33
34 for (; it1 != end; ++it1, ++it2) {
35 VERIFY(it1 == it2);
36 VERIFY(*it1 == *it2);
37 }
38 VERIFY(it2 == end);
39}
40
41int
42main()
43{
44 test01();
45 return 0;
46}