71 namespace seqan3::detail::adl_only
75 template <
typename ...args_t>
76 void to_rank(args_t ...) =
delete;
88 template <typename alph_t>
90 requires requires (alph_t const a)
92 { impl(priority_tag<2>{}, a) };
93 requires noexcept(impl(priority_tag<2>{}, a));
94 requires std::integral<decltype(impl(priority_tag<2>{}, a))>;
97 constexpr
auto operator()(alph_t
const a)
const noexcept
99 return impl(priority_tag<2>{}, a);
146 inline constexpr
auto to_rank = detail::adl_only::to_rank_fn{};
151 template <
typename semi_alphabet_type>
153 requires requires { {
seqan3::to_rank(std::declval<semi_alphabet_type>()) }; }
163 namespace seqan3::detail::adl_only
167 template <
typename ...args_t>
172 struct assign_rank_to_fn
181 template <typename alph_t>
185 { impl(priority_tag<2>{}, a, r) };
186 requires noexcept(impl(priority_tag<2>{}, a, r));
187 requires std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
192 return impl(priority_tag<2>{}, a, r);
252 namespace seqan3::detail::adl_only
256 template <
typename ...args_t>
257 void to_char(args_t ...) =
delete;
261 struct to_char_cpo :
public detail::customisation_point_object<to_char_cpo, 2>
264 using base_t = detail::customisation_point_object<to_char_cpo, 2>;
266 using base_t::base_t;
272 template <
typename alphabet_t>
282 template <
typename alphabet_t>
292 template <
typename alphabet_t>
295 std::forward<alphabet_t>(
alphabet).to_char()
343 inline constexpr
auto to_char = detail::adl_only::to_char_cpo{};
351 template <
typename alphabet_type>
363 namespace seqan3::detail::adl_only
367 template <
typename ...args_t>
372 struct assign_char_to_fn
381 template <typename alph_t>
385 { impl(priority_tag<2>{}, a, r) };
386 requires noexcept(impl(priority_tag<2>{}, a, r));
387 requires std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
392 return impl(priority_tag<2>{}, a, r);
444 inline constexpr
auto assign_char_to = detail::adl_only::assign_char_to_fn{};
452 namespace seqan3::detail::adl_only
456 template <
typename ...args_t>
463 template <
typename alph_t>
464 struct char_is_valid_for_fn
479 template <
typename dummy =
int>
481 requires requires (alphabet_char_t<alph_t>
const a)
483 { impl(priority_tag<3>{}, a, dummy{}) };
484 requires noexcept(impl(priority_tag<3>{}, a, dummy{}));
488 constexpr
bool operator()(alphabet_char_t<alph_t>
const a)
const noexcept
490 return impl(priority_tag<3>{}, a);
547 template <
typename alph_t>
549 requires requires { {
to_char(std::declval<alph_t>()) }; }
551 inline constexpr
auto char_is_valid_for = detail::adl_only::char_is_valid_for_fn<alph_t>{};
559 namespace seqan3::detail::adl_only
564 struct assign_char_strictly_to_fn
567 template <
typename alphabet_t>
573 std::convertible_to, alphabet_t);
578 if (!seqan3::char_is_valid_for<alphabet_t>(chr))
623 namespace seqan3::detail::adl_only
627 template <
typename ...args_t>
634 template <
typename alph_t>
635 struct alphabet_size_fn
640 seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alph_t>>,
650 template <
typename dummy =
int>
654 { impl(priority_tag<2>{}, s_alph_t{}, dummy{}) };
655 requires noexcept(impl(priority_tag<2>{}, s_alph_t{}, dummy{}));
656 requires std::integral<
std::remove_cvref_t<decltype(impl(priority_tag<2>{}, s_alph_t{}, dummy{}))>>;
659 constexpr
auto operator()() const noexcept
664 "Only overloads that are marked constexpr are picked up by seqan3::alphabet_size.");
665 return impl(priority_tag<2>{}, s_alph_t{});
669 #if SEQAN3_WORKAROUND_GCC_89953
670 template <
typename alph_t>
671 requires requires { { alphabet_size_fn<alph_t>{} }; }
672 inline constexpr
auto alphabet_size_obj = alphabet_size_fn<alph_t>{};
720 #if SEQAN3_WORKAROUND_GCC_89953
721 template <
typename alph_t>
723 requires requires { { detail::adl_only::alphabet_size_fn<alph_t>{} }; } &&
724 requires { { detail::adl_only::alphabet_size_obj<alph_t>() }; }
726 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_obj<alph_t>();
728 template <
typename alph_t>
730 requires requires { { detail::adl_only::alphabet_size_fn<alph_t>{}() }; }
732 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_fn<alph_t>{}();
781 template <
typename t>
783 std::totally_ordered<t> &&
784 std::copy_constructible<t> &&
785 std::is_nothrow_copy_constructible_v<t> &&
788 { seqan3::alphabet_size<t> };
832 template <
typename t>
871 template <
typename t>
919 template <
typename t>
951 template <cereal_output_archive archive_t, semialphabet alphabet_t>
952 alphabet_rank_t<alphabet_t> CEREAL_SAVE_MINIMAL_FUNCTION_NAME(archive_t
const &, alphabet_t
const & l)
970 template <cereal_input_archive archive_t,
typename wrapped_alphabet_t>
971 void CEREAL_LOAD_MINIMAL_FUNCTION_NAME(archive_t
const &,
972 wrapped_alphabet_t && l,
973 alphabet_rank_t<detail::strip_cereal_wrapper_t<wrapped_alphabet_t>>
const & r)
976 assign_rank_to(r,
static_cast<detail::strip_cereal_wrapper_t<wrapped_alphabet_t> &
>(l));
984 namespace seqan3::detail
999 template <
typename t>
1021 template <
typename t>
1043 template <
typename t>
1044 SEQAN3_CONCEPT constexpr_alphabet = constexpr_semialphabet<t> &&
alphabet<t> && requires
1066 template <
typename t>
1067 SEQAN3_CONCEPT writable_constexpr_alphabet =
1068 constexpr_alphabet<t> && writable_constexpr_semialphabet<t> &&
writable_alphabet<t> && requires
Exceptions thrown by entities in the alphabet module.
Adaptions of concepts from the Cereal library.
Helper utilities for defining customisation point objects (CPOs).
#define SEQAN3_CPO_IMPL(PRIO, TERM)
A macro that helps defining the overload set of a customisation point.
Definition: customisation_point.hpp:47
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition: customisation_point.hpp:113
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition: concept.hpp:435
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: concept.hpp:334
decltype(seqan3::to_rank(std::declval< semi_alphabet_type >())) alphabet_rank_t
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank.
Definition: concept.hpp:155
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition: concept.hpp:723
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:244
decltype(seqan3::to_char(std::declval< alphabet_type const >())) alphabet_char_t
The char_type of the alphabet; defined as the return type of seqan3::to_char.
Definition: concept.hpp:346
constexpr auto char_is_valid_for
Returns whether a character is in the valid set of a seqan3::alphabet (usually implies a bijective ma...
Definition: concept.hpp:542
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition: concept.hpp:606
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:146
#define SEQAN3_IS_CONSTEXPR(...)
Returns true if the expression passed to this macro can be evaluated at compile time,...
Definition: basic.hpp:28
The generic alphabet concept that covers most data types used in ranges.
The basis for seqan3::alphabet, but requires only rank interface (not char).
Refines seqan3::alphabet and adds assignability.
A refinement of seqan3::semialphabet that adds assignability.
A namespace for third party and standard library specialisations of SeqAn customisation points.
Definition: char.hpp:44
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
A type that can be specialised to provide customisation point implementations so that third party typ...
Definition: concept.hpp:49
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition: exception.hpp:26
Provides traits to inspect some information of a type, for example its name.
Provides C++20 additions to the type_traits header.
Provides various type traits on generic types.