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>();
752 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> };
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