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 // <iterator> 11 12 // reverse_iterator 13 14 // template <class Iterator> reverse_iterator<Iterator> 15 // make_reverse_iterator(Iterator i); 16 17 #include <iterator> 18 #include <cassert> 19 20 #include "test_iterators.h" 21 22 #if _LIBCPP_STD_VER > 11 23 24 template <class It> 25 void test(It i)26test(It i) 27 { 28 const std::reverse_iterator<It> r = std::make_reverse_iterator(i); 29 assert(r.base() == i); 30 } 31 main()32int main() 33 { 34 const char* s = "1234567890"; 35 random_access_iterator<const char*>b(s); 36 random_access_iterator<const char*>e(s+10); 37 while ( b != e ) 38 test ( b++ ); 39 } 40 #else main()41int main () {} 42 #endif 43