1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// <iterator>
10
11// reverse_iterator
12
13// reverse_iterator(); // constexpr since C++17
14
15#include <iterator>
16
17#include "test_macros.h"
18#include "test_iterators.h"
19
20template <class It>
21TEST_CONSTEXPR_CXX17 void test() {
22 std::reverse_iterator<It> r;
23 (void)r;
24}
25
26TEST_CONSTEXPR_CXX17 bool tests() {
27 test<bidirectional_iterator<const char*> >();
28 test<random_access_iterator<char*> >();
29#if TEST_STD_VER >= 20
30 test<cpp20_random_access_iterator<char*> >();
31#endif
32 test<char*>();
33 test<const char*>();
34 return true;
35}
36
37int main(int, char**) {
38 tests();
39#if TEST_STD_VER > 14
40 static_assert(tests(), "");
41#endif
42 return 0;
43}
44

source code of libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.default.pass.cpp