53 #if 0 // this is the alphabet_proxy I want, but GCC won't give me: 54 template <
typename derived_type,
typename alphabet_type>
55 class alphabet_proxy :
public alphabet_type
58 using base_t = alphabet_type;
62 using char_type = detail::transformation_trait_or_t<underlying_char<alphabet_type>,
void>;
63 using phred_type = detail::transformation_trait_or_t<underlying_phred<alphabet_type>,
void>;
65 using char_type_virtual = std::conditional_t<std::Same<char_type, void>, char, char_type>;
66 using phred_type_virtual = std::conditional_t<std::Same<phred_type, void>, int8_t, phred_type>;
68 constexpr alphabet_proxy() : base_t{} {}
69 constexpr alphabet_proxy(alphabet_proxy
const &) =
default;
70 constexpr alphabet_proxy(alphabet_proxy &&) =
default;
71 constexpr alphabet_proxy & operator=(alphabet_proxy
const &) =
default;
72 constexpr alphabet_proxy & operator=(alphabet_proxy &&) =
default;
73 ~alphabet_proxy() =
default;
75 constexpr alphabet_proxy(alphabet_type
const a) :
79 constexpr alphabet_proxy & operator=(alphabet_type
const & c) noexcept
82 static_cast<derived_type &
>(*this).on_update();
86 template <
typename indirect_assignable_type>
88 constexpr alphabet_proxy & operator=(indirect_assignable_type
const & c) noexcept
95 constexpr alphabet_proxy & assign_char(char_type_virtual
const c) noexcept
101 return operator=(tmp);
104 constexpr alphabet_proxy & assign_rank(underlying_rank_t<alphabet_type>
const r) noexcept
109 return operator=(tmp);
112 constexpr alphabet_proxy & assign_phred(phred_type_virtual
const c) noexcept
117 assign_phred(tmp, c);
118 return operator=(tmp);
123 #if 1// this is the one that works for most things, but not all 151 template <
typename derived_type,
typename alphabet_type>
153 alphabet_size_v<alphabet_type>,
154 detail::transformation_trait_or_t<underlying_char<alphabet_type>, void>>
159 alphabet_size_v<alphabet_type>,
160 detail::transformation_trait_or_t<underlying_char<alphabet_type>,
void>>;
173 using rank_type = underlying_rank_t<alphabet_type>;
174 using char_type = detail::transformation_trait_or_t<underlying_char<alphabet_type>,
void>;
175 using phred_type = detail::transformation_trait_or_t<underlying_phred<alphabet_type>,
void>;
180 using char_type_virtual = std::conditional_t<std::Same<char_type, void>, char, char_type>;
182 using phred_type_virtual = std::conditional_t<std::Same<phred_type, void>, int8_t, phred_type>;
201 constexpr derived_type & operator=(alphabet_type
const & c) noexcept
204 static_cast<derived_type &
>(*this).on_update();
205 return static_cast<derived_type &
>(*this);
209 template <
typename indirect_assignable_type>
210 constexpr derived_type & operator=(indirect_assignable_type
const & c) noexcept
228 constexpr derived_type &
assign_rank(underlying_rank_t<alphabet_type>
const r) noexcept
233 return operator=(tmp);
236 constexpr derived_type &
assign_char(char_type_virtual
const c) noexcept
242 return operator=(tmp);
245 constexpr derived_type &
assign_phred(phred_type_virtual
const c) noexcept
251 return operator=(tmp);
259 constexpr
operator alphabet_type()
const noexcept
266 constexpr char_type to_char()
const noexcept
270 return to_char(static_cast<alphabet_type>(*
this));
273 constexpr phred_type
to_phred()
const noexcept
277 return to_phred(static_cast<alphabet_type>(*
this));
280 #if 0 // this currently causes GCC ICE in cartesian_composition test 281 constexpr alphabet_type
complement()
const noexcept
285 return complement(static_cast<alphabet_type>(*
this));
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
Provides concepts for core language types and relations that don't have concepts in C++20 (yet)...
constexpr nucleotide_type complement(nucleotide_type const alph) requires requires(nucleotide_type alph)
Implementation of seqan3::nucleotide_concept::complement() that delegates to a member function...
Definition: member_exposure.hpp:220
A CRTP-base that eases the definition of proxy types returned in place of regular alphabets...
Definition: alphabet_proxy.hpp:152
The concept std::Assignable<LHS, RHS> specifies that an expression of the type and value category spe...
Resolves to std::is_assignable_v<t>.
constexpr underlying_phred_t< alphabet_type > to_phred(alphabet_type const &chr)
The public getter function for the phred representation of a score.
Definition: concept.hpp:127
constexpr alphabet_type & assign_phred(alphabet_type &chr, char const in)
The public setter function of a phred score.
Definition: concept.hpp:102
The generic alphabet concept that covers most data types used in ranges.This is the core alphabet con...
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
A concept that indicates whether an alphabet represents quality scores.In addition to the requirement...
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
constexpr alphabet_type & assign_rank(alphabet_type &alph, underlying_rank_t< alphabet_type > const rank) requires requires(alphabet_type alph)
Implementation of seqan3::semi_alphabet_concept::assign_rank() that delegates to a member function...
Definition: member_exposure.hpp:110
Provides seqan3::nucleotide_concept.
Provides seqan3::alphabet_base.
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:142
constexpr alphabet_type & assign_char(alphabet_type &alph, underlying_char_t< alphabet_type > const chr) requires requires(alphabet_type alph)
Implementation of seqan3::alphabet_concept::assign_char() that delegates to a member function...
Definition: member_exposure.hpp:178
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:77
Quality alphabet concept.
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
constexpr underlying_char_t< alphabet_type > to_char(alphabet_type const alph) requires requires(alphabet_type alph)
Implementation of seqan3::alphabet_concept::to_char() that delegates to a member function.
Definition: member_exposure.hpp:165
A concept that indicates whether an alphabet represents nucleotides.In addition to the requirements f...