70 namespace seqan3::detail::adl_only
74 template <
typename ...args_t>
75 void to_rank(args_t ...) =
delete;
87 template <typename alph_t>
89 requires requires (alph_t const a)
91 { impl(priority_tag<2>{}, a) };
92 requires noexcept(impl(priority_tag<2>{}, a));
93 requires std::integral<decltype(impl(priority_tag<2>{}, a))>;
96 constexpr
auto operator()(alph_t
const a)
const noexcept
98 return impl(priority_tag<2>{}, a);
143 inline constexpr
auto to_rank = detail::adl_only::to_rank_fn{};
148 template <
typename semi_alphabet_type>
150 requires requires { {
seqan3::to_rank(std::declval<semi_alphabet_type>()) }; }
160 namespace seqan3::detail::adl_only
164 template <
typename ...args_t>
169 struct assign_rank_to_fn
178 template <typename alph_t>
182 { impl(priority_tag<2>{}, a, r) };
183 requires noexcept(impl(priority_tag<2>{}, a, r));
184 requires std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
189 return impl(priority_tag<2>{}, a, r);
247 namespace seqan3::detail::adl_only
251 template <
typename ...args_t>
252 void to_char(args_t ...) =
delete;
264 template <typename alph_t>
266 requires requires (alph_t const a)
268 { impl(priority_tag<2>{}, a) };
269 requires noexcept(impl(priority_tag<2>{}, a));
273 constexpr decltype(
auto) operator()(alph_t const a) const noexcept
275 return impl(priority_tag<2>{}, a);
321 inline constexpr
auto to_char = detail::adl_only::to_char_fn{};
326 template <
typename alphabet_type>
338 namespace seqan3::detail::adl_only
342 template <
typename ...args_t>
347 struct assign_char_to_fn
356 template <typename alph_t>
360 { impl(priority_tag<2>{}, a, r) };
361 requires noexcept(impl(priority_tag<2>{}, a, r));
362 requires std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
367 return impl(priority_tag<2>{}, a, r);
425 namespace seqan3::detail::adl_only
429 template <
typename ...args_t>
436 template <
typename alph_t>
437 struct char_is_valid_for_fn
452 template <
typename dummy =
int>
454 requires requires (alphabet_char_t<alph_t>
const a)
456 { impl(priority_tag<3>{}, a, dummy{}) };
457 requires noexcept(impl(priority_tag<3>{}, a, dummy{}));
461 constexpr
bool operator()(alphabet_char_t<alph_t>
const a)
const noexcept
463 return impl(priority_tag<3>{}, a);
518 template <
typename alph_t>
520 requires requires { {
to_char(std::declval<alph_t>()) }; }
530 namespace seqan3::detail::adl_only
535 struct assign_char_strictly_to_fn
538 template <
typename alph_t>
548 if (!seqan3::char_is_valid_for<alph_t>(r))
555 template <
typename alph_t>
565 return operator()(r, a);
606 namespace seqan3::detail::adl_only
610 template <
typename ...args_t>
617 template <
typename alph_t>
618 struct alphabet_size_fn
623 seqan3::is_constexpr_default_constructible_v<std::remove_cvref_t<alph_t>>,
633 template <
typename dummy =
int>
637 { impl(priority_tag<2>{}, s_alph_t{}, dummy{}) };
638 requires noexcept(impl(priority_tag<2>{}, s_alph_t{}, dummy{}));
639 requires std::integral<
std::remove_cvref_t<decltype(impl(priority_tag<2>{}, s_alph_t{}, dummy{}))>>;
642 constexpr
auto operator()() const noexcept
647 "Only overloads that are marked constexpr are picked up by seqan3::alphabet_size.");
648 return impl(priority_tag<2>{}, s_alph_t{});
654 template <
typename alph_t>
655 requires requires { { alphabet_size_fn<alph_t>{} }; }
656 inline constexpr
auto alphabet_size_obj = alphabet_size_fn<alph_t>{};
702 template <
typename alph_t>
704 requires requires { { detail::adl_only::alphabet_size_fn<alph_t>{} }; } &&
705 requires { { detail::adl_only::alphabet_size_obj<alph_t>() }; }
707 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_obj<alph_t>();
753 template <
typename t>
755 std::totally_ordered<t> &&
756 std::copy_constructible<t> &&
757 std::is_nothrow_copy_constructible_v<t> &&
760 { seqan3::alphabet_size<t> };
802 template <
typename t>
839 template <
typename t>
886 template <
typename t>
891 { seqan3::char_is_valid_for<t>(c) };
918 template <cereal_output_archive archive_t, semialphabet alphabet_t>
919 alphabet_rank_t<alphabet_t> CEREAL_SAVE_MINIMAL_FUNCTION_NAME(archive_t
const &, alphabet_t
const & l)
937 template <cereal_input_archive archive_t,
typename wrapped_alphabet_t>
938 void CEREAL_LOAD_MINIMAL_FUNCTION_NAME(archive_t
const &,
939 wrapped_alphabet_t && l,
940 alphabet_rank_t<detail::strip_cereal_wrapper_t<wrapped_alphabet_t>>
const & r)
943 assign_rank_to(r,
static_cast<detail::strip_cereal_wrapper_t<wrapped_alphabet_t> &
>(l));
951 namespace seqan3::detail
966 template <
typename t>
988 template <
typename t>
1010 template <
typename t>
1011 SEQAN3_CONCEPT constexpr_alphabet = constexpr_semialphabet<t> &&
alphabet<t> && requires
1034 template <
typename t>
1035 SEQAN3_CONCEPT writable_constexpr_alphabet =
1036 constexpr_alphabet<t> && writable_constexpr_semialphabet<t> &&
writable_alphabet<t> && requires
Exceptions thrown by entities in the alphabet module.
Provides various type traits on generic types.
Adaptions of concepts from the Cereal library.
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
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
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition: concept.hpp:417
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: concept.hpp:321
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:152
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition: concept.hpp:707
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:239
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:330
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:522
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition: concept.hpp:598
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:143
#define SEQAN3_IS_CONSTEXPR(...)
Returns true if the expression passed to this macro can be evaluated at compile time,...
Definition: basic.hpp:29
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
typename remove_cvref< t >::type remove_cvref_t
Return the input type with const, volatile and references removed (transformation_trait shortcut).
Definition: type_traits:56
A type that can be specialised to provide customisation point implementations so that third party typ...
Definition: concept.hpp:48
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition: exception.hpp:26
The identity transformation (a transformation_trait that returns the input).
Definition: type_traits:73
Provides traits to inspect some information of a type, for example its name.
Provides C++20 additions to the type_traits header.