69 namespace seqan3::detail::adl_only
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>()) }; }
159 namespace seqan3::detail::adl_only
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));
183 requires
std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
188 return impl(priority_tag<2>{}, a, r);
246 namespace seqan3::detail::adl_only
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>
337 namespace seqan3::detail::adl_only
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));
361 requires
std::same_as<alph_t &, decltype(impl(priority_tag<2>{}, a, r))>;
366 return impl(priority_tag<2>{}, a, r);
424 namespace seqan3::detail::adl_only
428 template <
typename ...args_t>
435 template <
typename alph_t>
436 struct char_is_valid_for_fn
441 remove_cvref_t<alph_t>,
446 SEQAN3_CPO_IMPL(1, (deferred_type_t<remove_cvref_t<alph_t>, decltype(v)>::char_is_valid(v) ))
451 template <
typename dummy =
int>
453 requires requires (alphabet_char_t<alph_t>
const a)
455 { impl(priority_tag<3>{}, a, dummy{}) };
456 requires noexcept(impl(priority_tag<3>{}, a));
460 constexpr
bool operator()(alphabet_char_t<alph_t>
const a)
const noexcept
462 return impl(priority_tag<3>{}, a);
517 template <
typename alph_t>
519 requires requires { {
to_char(std::declval<alph_t>()) }; }
529 namespace seqan3::detail::adl_only
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);
605 namespace seqan3::detail::adl_only
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>>,
623 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>
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
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