blob: 89287bdd1d002fee79a3393ca0a8c5bd5a8c9983 [file] [log] [blame]
Howard Hinnant262b7792010-08-17 20:42:03 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant262b7792010-08-17 20:42:03 +00007//
8//===----------------------------------------------------------------------===//
9
10// <regex>
11
12// template <class BidirectionalIterator,
13// class charT = typename iterator_traits< BidirectionalIterator>::value_type,
14// class traits = regex_traits<charT>>
15// class regex_token_iterator
16// {
17// public:
18// typedef basic_regex<charT, traits> regex_type;
19// typedef sub_match<BidirectionalIterator> value_type;
20// typedef ptrdiff_t difference_type;
21// typedef const value_type* pointer;
22// typedef const value_type& reference;
23// typedef forward_iterator_tag iterator_category;
24
25#include <regex>
26#include <type_traits>
27
28template <class CharT>
29void
30test()
31{
32 typedef std::regex_token_iterator<const CharT*> I;
33 static_assert((std::is_same<typename I::regex_type, std::basic_regex<CharT> >::value), "");
34 static_assert((std::is_same<typename I::value_type, std::sub_match<const CharT*> >::value), "");
35 static_assert((std::is_same<typename I::difference_type, std::ptrdiff_t>::value), "");
36 static_assert((std::is_same<typename I::pointer, const std::sub_match<const CharT*>*>::value), "");
37 static_assert((std::is_same<typename I::reference, const std::sub_match<const CharT*>&>::value), "");
38 static_assert((std::is_same<typename I::iterator_category, std::forward_iterator_tag>::value), "");
39}
40
41int main()
42{
43 test<char>();
44 test<wchar_t>();
Howard Hinnantbbd80862010-08-22 00:45:01 +000045}