60template <
typename derived_type, writable_semialphabet alphabet_type>
61 requires std::regular<alphabet_type>
83 constexpr derived_type & operator=(derived_type
const & c)
noexcept
85 static_cast<derived_type &
>(*this).assign_rank(c.to_rank());
86 return static_cast<derived_type &
>(*this);
90 constexpr derived_type
const & operator=(derived_type
const & c)
const noexcept
92 static_cast<derived_type
const &
>(*this).assign_rank(c.to_rank());
93 return static_cast<derived_type
const &
>(*this);
97 constexpr derived_type & operator=(alphabet_type
const & c)
noexcept
100 return static_cast<derived_type &
>(*this);
104 constexpr derived_type
const & operator=(alphabet_type
const & c)
const noexcept
106 static_cast<derived_type
const &
>(*this).assign_rank(
108 return static_cast<derived_type
const &
>(*this);
112 template <
typename indirect_assignable_type>
113 constexpr derived_type & operator=(indirect_assignable_type
const & c)
const noexcept
140 return operator=(tmp);
144 constexpr derived_type
const &
assign_char(char_type
const c)
const noexcept
149 return operator=(tmp);
158 return operator=(tmp);
162 constexpr derived_type
const &
assign_phred(phred_type
const c)
const noexcept
167 return operator=(tmp);
176 constexpr operator alphabet_type() const noexcept
196 template <
typename other_t>
197 requires(std::convertible_to<alphabet_type, other_t>)
198 constexpr operator other_t()
const noexcept
200 return operator alphabet_type();
212 requires
quality<alphabet_type>
228 return char_is_valid_for<alphabet_type>(c);
233 friend constexpr void swap(derived_type
const & lhs, derived_type
const & rhs)
235 alphabet_type lhs_value = lhs.operator alphabet_type();
236 alphabet_type rhs_value = rhs.operator alphabet_type();
242 friend constexpr void swap(derived_type & lhs, derived_type & rhs)
244 alphabet_type lhs_value = lhs.operator alphabet_type();
245 alphabet_type rhs_value = rhs.operator alphabet_type();
256 friend constexpr bool operator==(derived_type
const lhs, derived_type
const rhs)
258 return lhs.to_rank() == rhs.to_rank();
262 friend constexpr auto operator<=>(derived_type
const lhs, derived_type
const rhs)
264 return lhs.to_rank() <=> rhs.to_rank();
268 template <meta::different_from<derived_type> t>
270 friend constexpr bool operator==(derived_type
const lhs, t
const rhs)
noexcept
272 return (lhs.operator alphabet_type() == rhs);
276 template <meta::different_from<derived_type> t>
278 friend constexpr bool operator==(t
const lhs, derived_type
const rhs)
noexcept
296 return a.assign_rank(r);
302 derived_type
const & a)
noexcept
309 return a.assign_rank(r);
331 return a.assign_char(c);
337 derived_type
const & a)
noexcept
344 return a.assign_char(c);
351 derived_type::char_is_valid(c)
355 return derived_type::char_is_valid(c);
364 derived_type::char_is_valid(c)
368 return derived_type::char_is_valid(c);
393 return a.complement();
415 return a.assign_phred(p);
421 derived_type
const & a)
noexcept
428 return a.assign_phred(p);
Provides bio::alphabet::nucleotide.
Quality alphabet concept.
Provides bio::alphabet::base.
Provides various type traits on generic types.
A CRTP-base that eases the definition of proxy types returned in place of regular alphabets.
Definition: proxy_base.hpp:63
constexpr derived_type & assign_phred(phred_type const c) noexcept
Assign from the numeric phred value.
Definition: proxy_base.hpp:153
constexpr derived_type const & assign_phred(phred_type const c) const noexcept
Assign from the numeric phred value.
Definition: proxy_base.hpp:162
friend constexpr auto operator<=>(derived_type const lhs, derived_type const rhs)
Checks order of lhs and rhs.
Definition: proxy_base.hpp:262
friend constexpr derived_type & tag_invoke(custom::assign_phred_to, phred_type const p, derived_type &a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:408
friend constexpr derived_type const & tag_invoke(custom::assign_char_to, char_type const c, derived_type const &a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:335
static constexpr auto alphabet_size
The alphabet size.
Definition: proxy_base.hpp:127
friend constexpr bool operator==(derived_type const lhs, derived_type const rhs)
Checks whether the letters lhs and rhs are equal.
Definition: proxy_base.hpp:256
friend constexpr phred_type tag_invoke(custom::to_phred, derived_type const a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:397
friend constexpr bool tag_invoke(custom::char_is_valid_for, char_type const c, derived_type) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:348
constexpr auto to_phred() const noexcept
Return the alphabet's value in phred representation.
Definition: proxy_base.hpp:211
friend constexpr derived_type & tag_invoke(custom::assign_rank_to, auto const r, derived_type &a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:289
friend constexpr derived_type const & tag_invoke(custom::assign_rank_to, auto const r, derived_type const &a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:300
friend constexpr derived_type & tag_invoke(custom::assign_char_to, char_type const c, derived_type &a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:324
friend consteval auto tag_invoke(custom::size, std::type_identity< derived_type >) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:379
constexpr derived_type & assign_char(char_type const c) noexcept
Assign from a character, implicitly converts invalid characters.
Definition: proxy_base.hpp:135
friend constexpr auto tag_invoke(custom::to_rank, derived_type const a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:286
static constexpr bool char_is_valid(char_type const c) noexcept
Delegate to the emulated type's validator.
Definition: proxy_base.hpp:225
constexpr alphabet_type complement() const noexcept
Return the complement of the letter.
Definition: proxy_base.hpp:218
friend constexpr auto tag_invoke(custom::complement, derived_type const a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:386
friend constexpr void swap(derived_type const &lhs, derived_type const &rhs)
Checks order of lhs and rhs.
Definition: proxy_base.hpp:233
friend constexpr auto tag_invoke(custom::to_char, derived_type const a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:313
friend constexpr void swap(derived_type &lhs, derived_type &rhs)
Checks order of lhs and rhs.
Definition: proxy_base.hpp:242
friend constexpr bool tag_invoke(custom::char_is_valid_for, char_type const c, std::type_identity< derived_type >) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:359
constexpr derived_type const & assign_char(char_type const c) const noexcept
Assign from a character, implicitly converts invalid characters.
Definition: proxy_base.hpp:144
constexpr auto to_char() const noexcept
Return the letter as a character of char_type.
Definition: proxy_base.hpp:204
friend consteval auto tag_invoke(custom::size, derived_type) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:372
friend constexpr derived_type const & tag_invoke(custom::assign_phred_to, phred_type const p, derived_type const &a) noexcept
tag_invoke() wrapper around member.
Definition: proxy_base.hpp:419
The generic alphabet concept that covers most data types used in ranges.
Definition: concept.hpp:643
A concept that indicates whether an alphabet represents nucleotides.
Definition: concept.hpp:113
A concept that indicates whether an alphabet represents quality scores.
Definition: concept.hpp:171
Refines bio::alphabet::alphabet and adds assignability.
Definition: concept.hpp:688
A concept that indicates whether a writable alphabet represents quality scores.
Definition: concept.hpp:208
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: concept.hpp:192
constexpr auto assign_char_to
Assign a char to an alphabet object.
Definition: concept.hpp:260
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:70
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:138
constexpr auto complement
Return the complement of a nucleotide object.
Definition: concept.hpp:68
constexpr auto assign_phred_to
Assign a phred score to a quality alphabet object.
Definition: concept.hpp:128
constexpr auto to_phred
The public getter function for the phred representation of a quality score.
Definition: concept.hpp:65
typename valid_template_spec_or< fallback_t, templ_t, spec_t... >::type valid_template_spec_or_t
Helper for bio::meta::valid_template_spec_or (transformation_trait shortcut).
Definition: template_inspection.hpp:244
The alphabet module's namespace.
Definition: aa10li.hpp:23
Customisation tag for bio::alphabet::assign_char_to.
Definition: tag.hpp:37
Customisation tag for bio::alphabet::assign_char_to.
Definition: tag.hpp:57
Customisation tag for bio::alphabet::assign_rank_to.#.
Definition: tag.hpp:29
Customisation tag for bio::alphabet::assign_char_to.
Definition: tag.hpp:41
Customisation tag for bio::alphabet::complement.
Definition: tag.hpp:49
CPO tag definition for bio::alphabet::size.
Definition: tag.hpp:45
Customisation tag for bio::alphabet::to_char.
Definition: tag.hpp:33
Customisation tag for bio::alphabet::assign_char_to.
Definition: tag.hpp:53
Customisation tag for bio::alphabet::to_rank.
Definition: tag.hpp:25
Provides various traits to inspect templates.