Provides customisation tags and alphabet adaptations of standard char and uint types.
More...
|
These overloads make char , wchar_t , char16_t and char32_t (but not signed char and unsigned char !) satisfy bio::alphabet::alphabet.
|
template<bio::meta::nonint_character char_type> |
consteval auto | bio::alphabet::custom::tag_invoke (size, char_type const) noexcept |
| The number of values the char type can take (e.g. 256 for char ).
|
|
template<bio::meta::nonint_character char_type> |
constexpr auto | bio::alphabet::custom::tag_invoke (to_rank tag, char_type const chr) noexcept |
| Convert char to rank by casting to an unsigned integral type of same size.
|
|
template<bio::meta::nonint_character char_type> |
constexpr char_type & | bio::alphabet::custom::tag_invoke (assign_rank_to tag, decltype(tag_invoke(to_rank{}, char_type{})) const rank, char_type &chr) noexcept |
| Assigning a rank to a char is the same as assigning it a numeric value.
|
|
template<bio::meta::nonint_character char_type> |
constexpr char_type | bio::alphabet::custom::tag_invoke (to_char tag, char_type const chr) noexcept |
| Converting char to char is no-op (it will just return the value you pass in).
|
|
template<bio::meta::nonint_character char_type> |
constexpr char_type & | bio::alphabet::custom::tag_invoke (assign_char_to tag, char_type const chr2, char_type &chr) noexcept |
| Assign a char to the char type (same as calling = ).
|
|
|
These overloads make uint8_t , uint16_t and uint32_t (but not uint64_t !) satisfy bio::alphabet::semialphabet.
|
template<alphabet::detail::uint_adaptation uint_type> |
consteval auto | bio::alphabet::custom::tag_invoke (size tag, uint_type const) noexcept |
| The number of values the uint type can take (e.g. 256 for uint8_t ).
|
|
template<alphabet::detail::uint_adaptation uint_type> |
constexpr uint_type & | bio::alphabet::custom::tag_invoke (assign_rank_to tag, uint_type const intgr2, uint_type &intgr) noexcept |
| Assign a rank to to the uint (same as calling = ).
|
|
template<alphabet::detail::uint_adaptation uint_type> |
constexpr auto | bio::alphabet::custom::tag_invoke (to_rank tag, uint_type const intgr) noexcept |
| Converting uint to rank is a no-op (it will just return the value you pass in).
|
|
Provides customisation tags and alphabet adaptations of standard char and uint types.
◆ tag_invoke() [1/6]
constexpr char_type & bio::alphabet::custom::tag_invoke |
( |
assign_char_to |
tag, |
|
|
char_type const |
chr2, |
|
|
char_type & |
chr |
|
) |
| |
|
constexprnoexcept |
Assign a char to the char type (same as calling =
).
- Parameters
-
[in] | tag | The tag for tag_invoke(). |
[in] | chr2 | The char value you wish to assign. |
[in,out] | chr | The alphabet letter that you wish to assign to. |
- Returns
- A reference to the alphabet letter you passed in.
◆ tag_invoke() [2/6]
constexpr char_type & bio::alphabet::custom::tag_invoke |
( |
assign_rank_to |
tag, |
|
|
decltype(tag_invoke(to_rank{}, char_type{})) const |
rank, |
|
|
char_type & |
chr |
|
) |
| |
|
constexprnoexcept |
Assigning a rank to a char is the same as assigning it a numeric value.
- Parameters
-
[in] | tag | The tag for tag_invoke(). |
[in] | rank | The rank value you wish to assign. |
[in,out] | chr | The alphabet letter that you wish to assign to. |
- Returns
- A reference to the alphabet letter you passed in.
◆ tag_invoke() [3/6]
template<alphabet::detail::uint_adaptation uint_type>
constexpr uint_type & bio::alphabet::custom::tag_invoke |
( |
assign_rank_to |
tag, |
|
|
uint_type const |
intgr2, |
|
|
uint_type & |
intgr |
|
) |
| |
|
constexprnoexcept |
Assign a rank to to the uint (same as calling =
).
- Parameters
-
[in] | tag | The tag for tag_invoke(). |
[in] | intgr2 | The rank value you wish to assign. |
[in,out] | intgr | The alphabet letter that you wish to assign to. |
- Returns
- A reference to the modified alphabet letter you passed in.
◆ tag_invoke() [4/6]
constexpr char_type bio::alphabet::custom::tag_invoke |
( |
to_char |
tag, |
|
|
char_type const |
chr |
|
) |
| |
|
constexprnoexcept |
Converting char to char is no-op (it will just return the value you pass in).
- Parameters
-
[in] | tag | The tag for tag_invoke(). |
[in] | chr | The alphabet letter that you wish to convert to char (no-op). |
- Returns
chr
.
◆ tag_invoke() [5/6]
constexpr auto bio::alphabet::custom::tag_invoke |
( |
to_rank |
tag, |
|
|
char_type const |
chr |
|
) |
| |
|
constexprnoexcept |
Convert char to rank by casting to an unsigned integral type of same size.
- Parameters
-
[in] | tag | The tag for tag_invoke(). |
[in] | chr | The alphabet letter that you wish to convert to rank. |
- Returns
- The letter's value in the alphabet's rank type (usually a
uint*_t
).
◆ tag_invoke() [6/6]
template<alphabet::detail::uint_adaptation uint_type>
constexpr auto bio::alphabet::custom::tag_invoke |
( |
to_rank |
tag, |
|
|
uint_type const |
intgr |
|
) |
| |
|
constexprnoexcept |
Converting uint to rank is a no-op (it will just return the value you pass in).
- Parameters
-
[in] | tag | The tag for tag_invoke(). |
[in] | intgr | The alphabet letter that you wish to convert to rank. |
- Returns
intgr
.