52 template <
typename char_type>
53 inline std::array<char_type, detail::size_in_values_v<char_type>> constexpr to_lower_table
57 std::array<char_type, detail::size_in_values_v<char_type>> ret{};
59 for (
size_t i = 0; i < detail::size_in_values_v<char_type>; ++i)
62 for (
size_t i = char_type{
'A'}; i <= char_type{
'Z'}; ++i)
63 ret[i] = ret[i] - char_type{
'A'} + char_type{
'a'};
70 template <
typename char_type>
71 inline std::array<char_type, detail::size_in_values_v<char_type>> constexpr to_upper_table
75 std::array<char_type, detail::size_in_values_v<char_type>> ret{};
77 for (
size_t i = 0; i < detail::size_in_values_v<char_type>; ++i)
80 for (
size_t i = char_type{
'a'}; i <= char_type{
'z'}; ++i)
81 ret[i] = ret[i] - char_type{
'a'} + char_type{
'A'};
106 template <
char_concept
char_type>
107 constexpr char_type
to_lower(char_type
const c) noexcept
109 using u_t = std::make_unsigned_t<char_type>;
110 return detail::to_lower_table<char_type>[
static_cast<u_t
>(c)];
122 template <
char_concept
char_type>
123 constexpr char_type
to_upper(char_type
const c) noexcept
125 using u_t = std::make_unsigned_t<char_type>;
126 return detail::to_upper_table<char_type>[
static_cast<u_t
>(c)];
Provides concepts for core language types and relations that don't have concepts in C++20 (yet)...
Contains metaprogramming utilities for integer types.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
Definition: aligned_sequence_concept.hpp:288
constexpr char_type to_upper(char_type const c) noexcept
Converts 'a'-'z' to 'A'-'Z' respectively; other characters are returned as is.
Definition: char_operations.hpp:123
constexpr char_type to_lower(char_type const c) noexcept
Converts 'A'-'Z' to 'a'-'z' respectively; other characters are returned as is.
Definition: char_operations.hpp:107