BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
char.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2022 deCODE Genetics
3// Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
4// Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
5// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
6// shipped with this file and also available at: https://github.com/biocpp/biocpp-core/blob/main/LICENSE.md
7// -----------------------------------------------------------------------------------------------------
8
27#pragma once
28
31
33{
34
42template <bio::meta::nonint_character char_type>
43consteval auto tag_invoke(size, char_type const) noexcept
44{
45 return meta::detail::min_viable_uint_v<meta::detail::size_in_values_v<char_type>>;
46}
47
54template <bio::meta::nonint_character char_type>
55constexpr auto tag_invoke(to_rank BIOCPP_DOXYGEN_ONLY(tag), char_type const chr) noexcept
56{
58}
59
67template <bio::meta::nonint_character char_type>
68constexpr char_type & tag_invoke(assign_rank_to BIOCPP_DOXYGEN_ONLY(tag),
69 decltype(tag_invoke(to_rank{}, char_type{})) const rank,
70 char_type & chr) noexcept
71{
72 return chr = rank;
73}
74
81template <bio::meta::nonint_character char_type>
82constexpr char_type tag_invoke(to_char BIOCPP_DOXYGEN_ONLY(tag), char_type const chr) noexcept
83{
84 return chr;
85}
86
94template <bio::meta::nonint_character char_type>
95constexpr char_type & tag_invoke(assign_char_to BIOCPP_DOXYGEN_ONLY(tag),
96 char_type const chr2,
97 char_type & chr) noexcept
98{
99 return chr = chr2;
100}
101
103
104} // namespace bio::alphabet::custom
Core alphabet concept and free function/type trait wrappers.
consteval auto tag_invoke(size, char_type const) noexcept
The number of values the char type can take (e.g. 256 for char).
Definition: char.hpp:43
Provides metaprogramming utilities for integer types.
A namespace for third party and standard library specialisations of BioC++ customisation points.
Definition: concept.hpp:43
Customisation tag for bio::alphabet::assign_char_to.
Definition: tag.hpp:37
Customisation tag for bio::alphabet::assign_rank_to.#.
Definition: tag.hpp:29
CPO tag definition for bio::alphabet::size.
Definition: tag.hpp:45
Customisation tag for bio::alphabet::to_char.
Definition: tag.hpp:33
Customisation tag for bio::alphabet::to_rank.
Definition: tag.hpp:25