73 template <
typename ...args_t>
74 void to_rank(args_t ...) =
delete;
86 template <typename alph_t>
88 requires requires (alph_t
const a)
90 { impl(priority_tag<2>{}, a) };
91 requires noexcept(impl(priority_tag<2>{}, a));
95 constexpr
auto operator()(alph_t
const a)
const noexcept
97 return impl(priority_tag<2>{}, a);
142 inline constexpr
auto to_rank = detail::adl_only::to_rank_fn{};
147 template <
typename semi_alphabet_type>
149 requires requires { {
seqan3::to_rank(std::declval<semi_alphabet_type>()) }; }
163 template <
typename ...args_t>
168 struct assign_rank_to_fn
177 template <typename alph_t>
181 { impl(priority_tag<2>{}, a, r) };
182 requires noexcept(impl(priority_tag<2>{}, a, r));
188 return impl(priority_tag<2>{}, a, r);
250 template <
typename ...args_t>
251 void to_char(args_t ...) =
delete;
263 template <typename alph_t>
265 requires requires (alph_t
const a)
267 { impl(priority_tag<2>{}, a) };
268 requires noexcept(impl(priority_tag<2>{}, a));
272 constexpr decltype(
auto) operator()(alph_t
const a)
const noexcept
274 return impl(priority_tag<2>{}, a);
320 inline constexpr
auto to_char = detail::adl_only::to_char_fn{};
325 template <
typename alphabet_type>
341 template <
typename ...args_t>
346 struct assign_char_to_fn
355 template <typename alph_t>
359 { impl(priority_tag<2>{}, a, r) };
360 requires noexcept(impl(priority_tag<2>{}, a, r));
366 return impl(priority_tag<2>{}, a, r);
428 template <
typename ...args_t>
435 template <
typename alph_t>
436 struct char_is_valid_for_fn
446 SEQAN3_CPO_IMPL(1, (deferred_type_t<remove_cvref_t<alph_t>, decltype(v)>::char_is_valid(v) ))
451 template <
typename dummy =
int>
455 { impl(priority_tag<3>{}, a, dummy{}) };
456 requires noexcept(impl(priority_tag<3>{}, a));
462 return impl(priority_tag<3>{}, a);
517 template <
typename alph_t>
519 requires requires { {
to_char(std::declval<alph_t>()) }; }
534 struct assign_char_strictly_to_fn
537 template <
typename alph_t>
542 { seqan3::char_is_valid_for<alph_t>(r) } ->
bool;
547 if (!seqan3::char_is_valid_for<alph_t>(r))
554 template <
typename alph_t>
559 { seqan3::char_is_valid_for<alph_t>(r) } ->
bool;
564 return operator()(r, a);
609 template <
typename ...args_t>
616 template <
typename alph_t>
617 struct alphabet_size_fn
622 seqan3::is_constexpr_default_constructible_v<remove_cvref_t<alph_t>>,
632 template <
typename dummy =
int>
636 { impl(priority_tag<2>{}, s_alph_t{}, dummy{}) };
637 requires noexcept(impl(priority_tag<2>{}, s_alph_t{}, dummy{}));
641 constexpr
auto operator()()
const noexcept
646 "Only overloads that are marked constexpr are picked up by seqan3::alphabet_size.");
647 return impl(priority_tag<2>{}, s_alph_t{});
653 template <
typename alph_t>
654 requires requires { { alphabet_size_fn<alph_t>{} }; }
655 inline constexpr
auto alphabet_size_obj = alphabet_size_fn<alph_t>{};
701 template <
typename alph_t>
703 requires requires { { detail::adl_only::alphabet_size_fn<alph_t>{} }; } &&
704 requires { { detail::adl_only::alphabet_size_obj<alph_t>() }; }
706 inline constexpr
auto alphabet_size = detail::adl_only::alphabet_size_obj<alph_t>();
751 template <
typename t>
756 std::is_nothrow_copy_constructible_v<t> &&
759 requires seqan3::alphabet_size<t> >= 0;
801 template <
typename t>
838 template <
typename t>
885 template <
typename t>
891 { seqan3::char_is_valid_for<t>(c) };
918 template <cereal_output_archive archive_t, semialphabet alphabet_t>
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));
965 template <
typename t>
987 template <
typename t>
1009 template <
typename t>
1011 SEQAN3_CONCEPT constexpr_alphabet = constexpr_semialphabet<t> &&
alphabet<t> && requires
1033 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 concepts for core language types and relations that don't have concepts in C++20 (yet)...
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:521
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: concept.hpp:238
#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 to_char
Return the char representation of an alphabet object.
Definition: concept.hpp:320
The basis for seqan3::alphabet, but requires only rank interface (not char).
Provides traits to inspect some information of a type, for example its name.
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:142
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition: concept.hpp:597
The concept std::copy_constructible is satisfied if T is an lvalue reference type, or if it is a move_constructible object type where an object of that type can constructed from a (possibly const) lvalue or const rvalue of that type in both direct- and copy-initialization contexts with the usual semantics (a copy is constructed with the source unchanged).
The main SeqAn3 namespace.
#define SEQAN3_IS_CONSTEXPR(...)
Returns true if the expression passed to this macro can be evaluated at compile time, false otherwise.
Definition: function.hpp:25
The concept integral is satisfied if and only if T is an integral type.
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:151
Requires std::equality_comparable and all remaing comparison operators (<, <=, >, >=)...
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:329
Adaptions of concepts from the Cereal library.
Definition: concept.hpp:41
Helper utilities for defining customisation point objects.
A type that can be specialised to provide customisation point implementations so that third party typ...
Definition: concept.hpp:46
A refinement of seqan3::semialphabet that adds assignability.
Definition: aligned_sequence_concept.hpp:36
The generic alphabet concept that covers most data types used in ranges.
Provides C++20 additions to the type_traits header.
The concept std::convertible_to<From, To> specifies that an expression of the type and value category...
This concept encompasses exactly the types char, signed char, unsigned char, wchar_t, char16_t and char32_t.
A namespace for third party and standard library specialisations of SeqAn customisation points...
Definition: char.hpp:42
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition: concept.hpp:416
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition: concept.hpp:706
Refines seqan3::alphabet and adds assignability.
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type...
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition: exception.hpp:25
The identity transformation (a transformation_trait that returns the input).
Definition: type_traits:31