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;
269 template <typename alph_t>
271 requires requires (alph_t const a)
273 { impl(priority_tag<2>{}, a) };
274 requires noexcept(impl(priority_tag<2>{}, a));
278 constexpr decltype(
auto) operator()(alph_t const a) const noexcept
280 return impl(priority_tag<2>{}, a);
328 inline constexpr
auto to_char = detail::adl_only::to_char_fn{};
336 template <
typename alphabet_type>
348 namespace seqan3::detail::adl_only
352 template <
typename ...args_t>
357 struct assign_char_to_fn
366 template <typename alph_t>
370 { impl(priority_tag<2>{}, a, r) };
371 requires noexcept(impl(priority_tag<2>{}, a, r));
372 requires std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
377 return impl(priority_tag<2>{}, a, r);
437 namespace seqan3::detail::adl_only
441 template <
typename ...args_t>
448 template <
typename alph_t>
449 struct char_is_valid_for_fn
464 template <
typename dummy =
int>
466 requires requires (alphabet_char_t<alph_t>
const a)
468 { impl(priority_tag<3>{}, a, dummy{}) };
469 requires noexcept(impl(priority_tag<3>{}, a, dummy{}));
473 constexpr
bool operator()(alphabet_char_t<alph_t>
const a)
const noexcept
475 return impl(priority_tag<3>{}, a);
532 template <
typename alph_t>
534 requires requires { {
to_char(std::declval<alph_t>()) }; }
544 namespace seqan3::detail::adl_only
549 struct assign_char_strictly_to_fn
552 template <
typename alph_t>
562 if (!seqan3::char_is_valid_for<alph_t>(r))
569 template <
typename alph_t>
579 return operator()(r, a);
621 namespace seqan3::detail::adl_only
625 template <
typename ...args_t>
632 template <
typename alph_t>
633 struct alphabet_size_fn
638 seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alph_t>>,
648 template <
typename dummy =
int>
652 { impl(priority_tag<2>{}, s_alph_t{}, dummy{}) };
653 requires noexcept(impl(priority_tag<2>{}, s_alph_t{}, dummy{}));
654 requires std::integral<
std::remove_cvref_t<decltype(impl(priority_tag<2>{}, s_alph_t{}, dummy{}))>>;
657 constexpr
auto operator()() const noexcept
662 "Only overloads that are marked constexpr are picked up by seqan3::alphabet_size.");
663 return impl(priority_tag<2>{}, s_alph_t{});
667 #if SEQAN3_WORKAROUND_GCC_89953
668 template <
typename alph_t>
669 requires requires { { alphabet_size_fn<alph_t>{} }; }
670 inline constexpr
auto alphabet_size_obj = alphabet_size_fn<alph_t>{};
718 #if SEQAN3_WORKAROUND_GCC_89953
719 template <
typename alph_t>
721 requires requires { { detail::adl_only::alphabet_size_fn<alph_t>{} }; } &&
722 requires { { detail::adl_only::alphabet_size_obj<alph_t>() }; }
724 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_obj<alph_t>();
726 template <
typename alph_t>
728 requires requires { { detail::adl_only::alphabet_size_fn<alph_t>{}() }; }
730 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_fn<alph_t>{}();
779 template <
typename t>
781 std::totally_ordered<t> &&
782 std::copy_constructible<t> &&
783 std::is_nothrow_copy_constructible_v<t> &&
786 { seqan3::alphabet_size<t> };
830 template <
typename t>
869 template <
typename t>
917 template <
typename t>
949 template <cereal_output_archive archive_t, semialphabet alphabet_t>
950 alphabet_rank_t<alphabet_t> CEREAL_SAVE_MINIMAL_FUNCTION_NAME(archive_t
const &, alphabet_t
const & l)
968 template <cereal_input_archive archive_t,
typename wrapped_alphabet_t>
969 void CEREAL_LOAD_MINIMAL_FUNCTION_NAME(archive_t
const &,
970 wrapped_alphabet_t && l,
971 alphabet_rank_t<detail::strip_cereal_wrapper_t<wrapped_alphabet_t>>
const & r)
974 assign_rank_to(r,
static_cast<detail::strip_cereal_wrapper_t<wrapped_alphabet_t> &
>(l));
982 namespace seqan3::detail
997 template <
typename t>
1019 template <
typename t>
1041 template <
typename t>
1042 SEQAN3_CONCEPT constexpr_alphabet = constexpr_semialphabet<t> &&
alphabet<t> && requires
1064 template <
typename t>
1065 SEQAN3_CONCEPT writable_constexpr_alphabet =
1066 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.
#define SEQAN3_CPO_IMPL(PRIO, TERM)
A macro that helps defining the overload set of a customisation point.
Definition: customisation_point.hpp:45
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:429
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: concept.hpp:328
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:730
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:340
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:536
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition: concept.hpp:613
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.
This concept encompasses exactly the types char, signed char, unsigned char, wchar_t,...
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.