76 template <
typename derived_type,
size_t size,
typename char_t =
char>
81 static_assert(
size > 0,
"It does not make sense to use the base class for alphabets of size < 1.");
125 return derived_type::rank_to_char[rank];
170 using index_t = std::make_unsigned_t<char_type>;
171 rank = derived_type::char_to_rank[
static_cast<index_t
>(c)];
172 return static_cast<derived_type &
>(*this);
191 assert(static_cast<size_t>(c) < static_cast<size_t>(
value_size));
193 return static_cast<derived_type &
>(*this);
202 friend constexpr
bool operator==(derived_type
const & lhs, derived_type
const & rhs) noexcept
208 friend constexpr
bool operator!=(derived_type
const & lhs, derived_type
const & rhs) noexcept
214 friend constexpr
bool operator<(derived_type
const & lhs, derived_type
const & rhs) noexcept
220 friend constexpr
bool operator>(derived_type
const & lhs, derived_type
const & rhs) noexcept
226 friend constexpr
bool operator<=(derived_type
const & lhs, derived_type
const & rhs) noexcept
232 friend constexpr
bool operator>=(derived_type
const & lhs, derived_type
const & rhs) noexcept
detail::min_viable_uint_t< size - 1 > rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition: alphabet_base.hpp:89
char_t char_type
The type of the alphabet when converted to char (e.g. via to_char()).
Definition: alphabet_base.hpp:87
Free function/metafunction wrappers for alphabets with member functions/types.
Contains metaprogramming utilities for integer types.
SeqAn specific customisations in the standard namespace.
Definition: align_result.hpp:221
::ranges::size size
Alias for ranges::size. Obtains the size of a range whose size can be calculated in constant time...
Definition: ranges:195
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:189
static detail::min_viable_uint_t< size > constexpr value_size
The size of the alphabet, i.e. the number of different values it can take.
Definition: alphabet_base.hpp:198
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
constexpr char_type to_char() const noexcept
Return the letter as a character of char_type.
Definition: alphabet_base.hpp:120
constexpr derived_type & assign_char(std::conditional_t< std::Same< char_type, void >, char, char_type > const c) noexcept
Assign from a character.
Definition: alphabet_base.hpp:165
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:142
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:77
Implementation of a masked alphabet to be used for cartesian compositions.
Definition: mask.hpp:61
constexpr underlying_rank_t< alphabet_type > to_rank(alphabet_type const alph) requires requires(alphabet_type alph)
Implementation of seqan3::semi_alphabet_concept::to_rank() that delegates to a member function...
Definition: member_exposure.hpp:97