SeqAn3
3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
integer_traits.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
5
#pragma once
6
7
#include <
limits
>
8
#include <
type_traits
>
9
10
#include <
seqan3/core/platform.hpp
>
11
17
namespace
seqan3::detail
18
{
19
20
// ------------------------------------------------------------------
21
// min_viable_uint_t
22
// ------------------------------------------------------------------
23
26
template
<u
int
64_t value>
27
using
min_viable_uint_t =
std::conditional_t
<
28
value <= 1ull,
29
bool,
30
std::conditional_t
<value <= 255ull,
31
uint8_t,
32
std::conditional_t
<value <= 65535ull,
33
uint16_t,
34
std::conditional_t<value <= 4294967295ull, uint32_t, uint64_t>
>>>;
35
39
template
<u
int
64_t value>
40
constexpr
auto
min_viable_uint_v =
static_cast<
min_viable_uint_t<value>
>
(value);
41
42
// ------------------------------------------------------------------
43
// size_in_values_v
44
// ------------------------------------------------------------------
45
48
template
<
typename
int
_t>
49
requires
std::is_integral_v<int_t>
50
constexpr
size_t
size_in_values_v =
51
static_cast<
size_t
>
(
std::numeric_limits<int_t>::max
()) -
std::numeric_limits<int_t>::lowest
() + 1;
52
53
}
// namespace seqan3::detail
std::conditional_t
limits
std::numeric_limits::max
T max(T... args)
std::numeric_limits
platform.hpp
Provides platform and dependency checks.
type_traits
Hide me
Version:
seqan3
utility
detail
integer_traits.hpp
Generated on Mon Mar 4 2024 20:37:00 for SeqAn3 by
1.9.8