Differential D100278 Diff 342544 libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
template<std::ranges::forward_range> | template<std::ranges::forward_range> | ||||
requires true | requires true | ||||
[[nodiscard]] constexpr bool check_forward_range_subsumption() { | [[nodiscard]] constexpr bool check_forward_range_subsumption() { | ||||
return true; | return true; | ||||
} | } | ||||
// clang-format on | // clang-format on | ||||
static_assert(check_forward_range_subsumption<range>()); | static_assert(check_forward_range_subsumption<range>()); | ||||
// clang-format off | |||||
template<std::ranges::forward_range R> | |||||
requires std::bidirectional_iterator<std::ranges::iterator_t<R> > | |||||
[[nodiscard]] constexpr bool check_bidirectional_range_subsumption() { | |||||
return false; | |||||
} | |||||
template<std::ranges::bidirectional_range> | |||||
requires true | |||||
[[nodiscard]] constexpr bool check_bidirectional_range_subsumption() { | |||||
return true; | |||||
} | |||||
// clang-format on | |||||
static_assert(check_bidirectional_range_subsumption<range>()); |