27namespace bio::ranges::detail
45template <
typename type>
46concept container =
requires(type val, type val2, type
const cval,
typename type::iterator it) {
48 typename type::value_type;
49 typename type::reference;
50 typename type::const_reference;
74 { type{} } -> std::same_as<type>;
75 { type{type{}} } -> std::same_as<type>;
76 { val = val2 } -> std::same_as<type &>;
79 { val.begin() } -> std::same_as<typename type::iterator>;
80 { val.end() } -> std::same_as<typename type::iterator>;
81 { cval.begin() } -> std::same_as<typename type::const_iterator>;
82 { cval.end() } -> std::same_as<typename type::const_iterator>;
83 { val.cbegin() } -> std::same_as<typename type::const_iterator>;
84 { val.cend() } -> std::same_as<typename type::const_iterator>;
86 requires !std::equality_comparable<typename type::value_type> || std::equality_comparable<type>;
88 { val.swap(val2) } -> std::same_as<void>;
89 {
swap(val, val2) } -> std::same_as<void>;
90 {
std::swap(val, val2) } -> std::same_as<void>;
92 { val.size() } -> std::same_as<typename type::size_type>;
93 { val.max_size() } -> std::same_as<typename type::size_type>;
94 { val.empty() } -> std::same_as<bool>;
109template <
typename type>
110concept sequence_container =
requires(type val, type val2, type
const cval) {
111 requires container<type>;
115 { type{
typename type::size_type{},
typename type::value_type{}} };
116 { type{val2.begin(), val2.end()} };
121 { val.assign(val2.begin(), val2.end()) };
123 { val.assign(
typename type::size_type{},
typename type::value_type{}) };
129 { val.insert(val.cbegin(), val2.front()) } -> std::same_as<typename type::iterator>;
130 { val.insert(val.cbegin(),
typename type::value_type{}) } -> std::same_as<typename type::iterator>;
131 { val.insert(val.cbegin(),
typename type::size_type{},
typename type::value_type{}) }
132 -> std::same_as<typename type::iterator>;
133 { val.insert(val.cbegin(), val2.begin(), val2.end()) } -> std::same_as<typename type::iterator>;
135 std::same_as<typename type::iterator>;
137 { val.erase(val.cbegin()) } -> std::same_as<typename type::iterator>;
138 { val.erase(val.cbegin(), val.cend()) } -> std::same_as<typename type::iterator>;
140 { val.push_back(val.front()) } -> std::same_as<void>;
141 { val.push_back(
typename type::value_type{}) } -> std::same_as<void>;
142 { val.pop_back() } -> std::same_as<void>;
143 { val.clear() } -> std::same_as<void>;
146 { val.front() } -> std::same_as<typename type::reference>;
147 { cval.front() } -> std::same_as<typename type::const_reference>;
148 { val.back() } -> std::same_as<typename type::reference>;
149 { cval.back() } -> std::same_as<typename type::const_reference>;
166template <
typename type>
167concept random_access_container =
requires(type val) {
168 requires sequence_container<type>;
172 { val[0] } -> std::same_as<typename type::reference>;
173 { val.at(0) } -> std::same_as<typename type::reference>;
176 { val.resize(0) } -> std::same_as<void>;
177 { val.resize(0,
typename type::value_type{}) } -> std::same_as<void>;
190template <
typename type>
191concept reservible_container =
requires(type val) {
192 requires random_access_container<type>;
195 { val.capacity() } -> std::same_as<typename type::size_type>;
196 { val.reserve(0) } -> std::same_as<void>;
197 { val.shrink_to_fit() } -> std::same_as<void>;
Provides platform and dependency checks.