Home | History | Annotate | Download | only in re.regiter
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      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_iterator
     16 // {
     17 // public:
     18 //     typedef basic_regex<charT, traits>           regex_type;
     19 //     typedef match_results<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 #include "test_macros.h"
     28 
     29 template <class CharT>
     30 void
     31 test()
     32 {
     33     typedef std::regex_iterator<const CharT*> I;
     34     static_assert((std::is_same<typename I::regex_type, std::basic_regex<CharT> >::value), "");
     35     static_assert((std::is_same<typename I::value_type, std::match_results<const CharT*> >::value), "");
     36     static_assert((std::is_same<typename I::difference_type, std::ptrdiff_t>::value), "");
     37     static_assert((std::is_same<typename I::pointer, const std::match_results<const CharT*>*>::value), "");
     38     static_assert((std::is_same<typename I::reference, const std::match_results<const CharT*>&>::value), "");
     39     static_assert((std::is_same<typename I::iterator_category, std::forward_iterator_tag>::value), "");
     40 }
     41 
     42 int main()
     43 {
     44     test<char>();
     45     test<wchar_t>();
     46 }
     47