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 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
10 | |
11 | // template<class In> |
12 | // concept indirectly_readable; |
13 | |
14 | #include <iterator> |
15 | |
16 | #include <concepts> |
17 | #include <memory> |
18 | #include <optional> |
19 | |
20 | #include "../incrementable.h" |
21 | |
22 | static_assert(std::incrementable<int>); |
23 | static_assert(std::incrementable<int*>); |
24 | static_assert(std::incrementable<int**>); |
25 | |
26 | static_assert(!std::incrementable<postfix_increment_returns_void>); |
27 | static_assert(!std::incrementable<postfix_increment_returns_copy>); |
28 | static_assert(!std::incrementable<has_integral_minus>); |
29 | static_assert(!std::incrementable<has_distinct_difference_type_and_minus>); |
30 | static_assert(!std::incrementable<missing_difference_type>); |
31 | static_assert(!std::incrementable<floating_difference_type>); |
32 | static_assert(!std::incrementable<non_const_minus>); |
33 | static_assert(!std::incrementable<non_integral_minus>); |
34 | static_assert(!std::incrementable<bad_difference_type_good_minus>); |
35 | static_assert(!std::incrementable<not_default_initializable>); |
36 | static_assert(!std::incrementable<not_movable>); |
37 | static_assert(!std::incrementable<preinc_not_declared>); |
38 | static_assert(!std::incrementable<postinc_not_declared>); |
39 | static_assert(std::incrementable<incrementable_with_difference_type>); |
40 | static_assert(std::incrementable<incrementable_without_difference_type>); |
41 | static_assert(std::incrementable<difference_type_and_void_minus>); |
42 | static_assert(!std::incrementable<noncopyable_with_difference_type>); |
43 | static_assert(!std::incrementable<noncopyable_without_difference_type>); |
44 | static_assert(!std::incrementable<noncopyable_with_difference_type_and_minus>); |
45 | |