BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
int_types.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
9#pragma once
10
11#include <concepts>
12#include <limits>
13#include <type_traits>
14
15#include <bio/core.hpp>
16
22namespace bio::meta::detail
23{
24
25// ------------------------------------------------------------------
26// min_viable_uint_t
27// ------------------------------------------------------------------
28
29// clang-format off
31template <uint64_t value>
32using min_viable_uint_t = std::conditional_t<value <= 255ull, uint8_t,
33 std::conditional_t<value <= 65535ull, uint16_t,
35// clang-format on
36
39template <uint64_t value>
40inline constexpr auto min_viable_uint_v = static_cast<min_viable_uint_t<value>>(value);
41
42// ------------------------------------------------------------------
43// size_in_values_v
44// ------------------------------------------------------------------
45
47template <std::integral int_t>
48inline constexpr size_t size_in_values_v =
50
51} // namespace bio::meta::detail
Provides platform and dependency checks.
T max(T... args)