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
11
17namespace seqan3::detail
18{
19
20// ------------------------------------------------------------------
21// min_viable_uint_t
22// ------------------------------------------------------------------
23
26template <uint64_t value>
27using 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,
35
39template <uint64_t value>
40constexpr auto min_viable_uint_v = static_cast<min_viable_uint_t<value>>(value);
41
42// ------------------------------------------------------------------
43// size_in_values_v
44// ------------------------------------------------------------------
45
48template <typename int_t>
49 requires std::is_integral_v<int_t>
50constexpr size_t size_in_values_v =
52
53} // namespace seqan3::detail
T max(T... args)
Provides platform and dependency checks.
Hide me