1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // reference operator*() const; // constexpr in C++17
15 // Be sure to respect LWG 198:
16 // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#198
17 // LWG 198 was superseded by LWG 2360
18 // http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2360
23 #include "test_macros.h"
30 A(const A
&) = default;
31 A
& operator=(const A
&) = default;
34 friend bool operator==(const A
& x
, const A
& y
)
35 {return x
.data_
== y
.data_
;}
40 test(It i
, typename
std::iterator_traits
<It
>::value_type x
)
42 std::reverse_iterator
<It
> r(i
);
53 constexpr const char *p
= "123456789";
54 typedef std::reverse_iterator
<const char *> RI
;
55 constexpr RI it1
= std::make_reverse_iterator(p
+1);
56 constexpr RI it2
= std::make_reverse_iterator(p
+2);
57 static_assert(*it1
== p
[0], "");
58 static_assert(*it2
== p
[1], "");