summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp
blob: 5b79957bea241cc5fd6260a4e7403d2efa8049fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <regex>

// template <class BidirectionalIterator,
//           class charT = typename iterator_traits< BidirectionalIterator>::value_type,
//           class traits = regex_traits<charT>>
// class regex_iterator
// {
// public:
//     typedef basic_regex<charT, traits>           regex_type;
//     typedef match_results<BidirectionalIterator> value_type;
//     typedef ptrdiff_t                            difference_type;
//     typedef const value_type*                    pointer;
//     typedef const value_type&                    reference;
//     typedef forward_iterator_tag                 iterator_category;

#include <regex>
#include <type_traits>
#include "test_macros.h"

template <class CharT>
void
test()
{
    typedef std::regex_iterator<const CharT*> I;
    static_assert((std::is_same<typename I::regex_type, std::basic_regex<CharT> >::value), "");
    static_assert((std::is_same<typename I::value_type, std::match_results<const CharT*> >::value), "");
    static_assert((std::is_same<typename I::difference_type, std::ptrdiff_t>::value), "");
    static_assert((std::is_same<typename I::pointer, const std::match_results<const CharT*>*>::value), "");
    static_assert((std::is_same<typename I::reference, const std::match_results<const CharT*>&>::value), "");
    static_assert((std::is_same<typename I::iterator_category, std::forward_iterator_tag>::value), "");
}

int main()
{
    test<char>();
    test<wchar_t>();
}
OpenPOWER on IntegriCloud