BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
char.hpp File Reference

Provides alphabet adaptations for standard char types. More...

+ Include dependency graph for char.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  bio
 The main BioC++ namespace.
 
namespace  bio::alphabet
 The alphabet module's namespace.
 
namespace  bio::alphabet::custom
 A namespace for third party and standard library specialisations of BioC++ customisation points.
 

Functions

Adapt builtin character types as alphabets.

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>
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 =).
 
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>
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 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 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.
 

Detailed Description

Provides alphabet adaptations for standard char types.

Author
Hannes Hauswedell <hannes.hauswedell AT decode.is>

This file provides function and type trait overloads so that the following types fulfil the bio::alphabet::alphabet:

  • char
  • char16_t
  • char32_t

You will likely not use these interfaces directly, they are, however, very helpful for conversions between other alphabets and between other alphabets and characters.

Attention
  • Note that signed char and unsigned char are absent from the list, because of their type ambiguity with int8_t and uint8_t.