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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // constexpr common_iterator(I i);
16 #include "test_iterators.h"
19 constexpr bool test() {
20 using CommonIt
= std::common_iterator
<It
, sentinel_wrapper
<It
>>;
23 CommonIt lv
= CommonIt(it
);
25 CommonIt rv
= CommonIt(std::move(it
));
31 int main(int, char**) {
32 test
<cpp17_input_iterator
<int*>>();
33 test
<forward_iterator
<int*>>();
34 test
<bidirectional_iterator
<int*>>();
35 test
<random_access_iterator
<int*>>();
36 test
<contiguous_iterator
<int*>>();
40 static_assert(test
<cpp17_input_iterator
<int*>>());
41 static_assert(test
<forward_iterator
<int*>>());
42 static_assert(test
<bidirectional_iterator
<int*>>());
43 static_assert(test
<random_access_iterator
<int*>>());
44 static_assert(test
<contiguous_iterator
<int*>>());
45 static_assert(test
<int*>());
46 static_assert(test
<const int*>());