23namespace seqan3::detail
35class constexpr_pseudo_bitset :
public std::array<bool, N>
46 constexpr constexpr_pseudo_bitset
operator|(constexpr_pseudo_bitset rhs)
const noexcept
48 for (
size_t i = 0; i < N; ++i)
49 rhs[i] = rhs[i] || base_t::operator[](i);
54 constexpr constexpr_pseudo_bitset operator~() const noexcept
56 constexpr_pseudo_bitset ret{};
57 for (
size_t i = 0; i < N; ++i)
58 ret[i] = !base_t::operator[](i);
76template <
char op,
typename condition_head_t,
typename... condition_ts>
87template <
typename condition_t>
88struct char_predicate_base;
101template <
typename condition_t>
102concept char_predicate =
requires {
103 requires std::predicate<std::remove_reference_t<condition_t>,
char>;
140template <char_predicate... condition_ts>
141 requires (
sizeof...(condition_ts) >= 2)
142struct char_predicate_disjunction;
144template <
char_predicate condition_t>
145struct char_predicate_negator;
154template <
typename derived_t>
155struct char_predicate_base
158 using data_t = constexpr_pseudo_bitset<257>;
165 template <
char_predicate rhs_t>
166 constexpr auto operator||(rhs_t
const &)
const
168 return char_predicate_disjunction<derived_t, rhs_t>{};
172 constexpr auto operator!()
const
174 return char_predicate_negator<derived_t>{};
182 template <std::
integral value_t>
183 constexpr bool operator()(value_t
const val)
const noexcept
184 requires (
sizeof(value_t) == 1)
186 return derived_t::data[
static_cast<unsigned char>(val)];
190 template <std::
integral value_t>
191 constexpr bool operator()(value_t
const val)
const noexcept
192 requires (
sizeof(value_t) != 1)
202 std::same_as<value_t, std::char_traits<char>::int_type>,
205 std::same_as<value_t, std::char_traits<wchar_t>::int_type>,
208 std::same_as<value_t, std::char_traits<char8_t>::int_type>,
211 std::same_as<value_t, std::char_traits<char16_t>::int_type>,
216 static_assert(!std::same_as<char_value_t, void>,
"There is no valid character representation.");
219 : (char_trait::eq_int_type(val, char_trait::eof())) ? derived_t::data[256]
230 return derived_t::msg;
245template <char_predicate... condition_ts>
246 requires (
sizeof...(condition_ts) >= 2)
247struct char_predicate_disjunction :
public char_predicate_base<char_predicate_disjunction<condition_ts...>>
250 static inline std::string const msg = detail::condition_message_v<
'|', condition_ts...>;
253 using base_t = char_predicate_base<char_predicate_disjunction<condition_ts...>>;
256 using typename base_t::data_t;
258 static constexpr data_t
data = (condition_ts::data | ...);
267template <
char_predicate condition_t>
268struct char_predicate_negator :
public char_predicate_base<char_predicate_negator<condition_t>>
274 using base_t = char_predicate_base<char_predicate_negator<condition_t>>;
277 using typename base_t::data_t;
279 static constexpr data_t
data = ~condition_t::data;
294template <u
int8_t
interval_first, u
int8_t
interval_last>
295 requires (interval_first <= interval_last)
296struct is_in_interval_type : public char_predicate_base<is_in_interval_type<interval_first, interval_last>>
303 using base_t = char_predicate_base<is_in_interval_type<interval_first, interval_last>>;
306 using typename base_t::data_t;
308 static constexpr data_t
data = []()
constexpr
312 for (
size_t i = interval_first; i <= static_cast<size_t>(interval_last); ++i)
329struct is_char_type :
public char_predicate_base<is_char_type<char_v>>
331 static_assert(char_v == EOF ||
static_cast<uint64_t
>(char_v) < 256,
"TODO");
338 using base_t = char_predicate_base<is_char_type<char_v>>;
341 using typename base_t::data_t;
343 static constexpr data_t
data = []()
constexpr
350 ret[
static_cast<uint8_t
>(char_v)] =
true;
Provides various type traits on generic types.
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
auto operator|(validator1_type &&vali1, validator2_type &&vali2)
Enables the chaining of validators.
Definition validators.hpp:1117
Provides traits to inspect some information of a type, for example its name.
Provides concepts that do not have equivalents in C++20.