18#if __has_include(<fmt/format.h>)
20# include <fmt/format.h>
21# include <fmt/ranges.h>
26template <
typename alph_t>
28struct fmt::formatter<alph_t> : fmt::formatter<bio::alphabet::char_t<alph_t>, bio::alphabet::char_t<alph_t>>
30 constexpr auto format(alph_t
const a,
auto & ctx)
const
42template <bio::alphabet::detail::alphabet_tuple_like alph_t>
54template <
typename rng_t>
56 std::ranges::forward_range<rng_t> &&
57 (!std::integral<std::ranges::range_value_t<rng_t>>)&&
bio::alphabet::alphabet<std::ranges::range_reference_t<rng_t>>;
59template <bio_range rng_t>
60struct fmt::is_range<rng_t,
bio::alphabet::char_t<std::ranges::range_reference_t<rng_t>>> :
std::false_type
63template <bio_range rng_t,
typename _
char_t>
64struct fmt::formatter<rng_t, _char_t> :
66 fmt::join_view<std::ranges::iterator_t<decltype(std::declval<rng_t const &>() | bio::ranges::views::to_char)>,
67 std::ranges::sentinel_t<decltype(std::declval<rng_t const &>() | bio::ranges::views::to_char)>,
68 bio::alphabet::char_t<std::ranges::range_reference_t<rng_t const>>>,
73 auto format(rng_t
const & r,
auto & ctx)
const
77 fmt::formatter<fmt::join_view<std::ranges::iterator_t<trans_t>,
78 std::ranges::sentinel_t<trans_t>,
84# error "You included bio/alphabet/fmt.hpp which only works if the {fmt}-library is present."
Provides implementation detail for bio::alphabet::variant and bio::alphabet::tuple_base.
Core alphabet concept and free function/type trait wrappers.
The generic alphabet concept that covers most data types used in ranges.
Definition: concept.hpp:643
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: concept.hpp:192
decltype(bio::alphabet::to_char(std::declval< alphabet_type const >())) char_t
The char_type of the alphabet; defined as the return type of bio::alphabet::to_char.
Definition: concept.hpp:212
auto const to_char
A view that calls bio::alphabet::to_char() on each element in the input range.
Definition: to_char.hpp:100
The main BioC++ namespace.
Definition: aa10li.hpp:23
Provides bio::views::to_char.