BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
uint.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
32
33namespace bio::alphabet::detail
34{
38template <typename type>
39concept uint_adaptation = meta::one_of<type, uint8_t, uint16_t, uint32_t>;
40} // namespace bio::alphabet::detail
41
43{
44
51template <alphabet::detail::uint_adaptation uint_type>
52consteval auto tag_invoke(size BIOCPP_DOXYGEN_ONLY(tag), uint_type const) noexcept
53{
54 return meta::detail::min_viable_uint_v<meta::detail::size_in_values_v<uint_type>>;
55}
56
64template <alphabet::detail::uint_adaptation uint_type>
65constexpr uint_type & tag_invoke(assign_rank_to BIOCPP_DOXYGEN_ONLY(tag),
66 uint_type const intgr2,
67 uint_type & intgr) noexcept
68{
69 return intgr = intgr2;
70}
71
78template <alphabet::detail::uint_adaptation uint_type>
79constexpr auto tag_invoke(to_rank BIOCPP_DOXYGEN_ONLY(tag), uint_type const intgr) noexcept
80{
81 return intgr;
82}
83
85
86} // namespace bio::alphabet::custom
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
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_rank_to.#.
Definition: tag.hpp:29
CPO tag definition for bio::alphabet::size.
Definition: tag.hpp:45
Customisation tag for bio::alphabet::to_rank.
Definition: tag.hpp:25
Provides the customisation tags for the alphabet concepts.