Home | History | Annotate | Download | only in re.results.all
      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 // class match_results<BidirectionalIterator, Allocator>
     13 
     14 // allocator_type get_allocator() const;
     15 
     16 #include <regex>
     17 #include <cassert>
     18 
     19 #include "test_macros.h"
     20 #include "test_allocator.h"
     21 
     22 template <class CharT, class Allocator>
     23 void
     24 test(const Allocator& a)
     25 {
     26     std::match_results<const CharT*, Allocator> m(a);
     27     assert(m.size() == 0);
     28     assert(m.str() == std::basic_string<CharT>());
     29     assert(m.get_allocator() == a);
     30 }
     31 
     32 int main()
     33 {
     34     test<char>(test_allocator<std::sub_match<const char*> >(3));
     35     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
     36 }
     37