SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
int_types.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <type_traits>
11 
12 #include <seqan3/std/concepts>
13 
19 namespace seqan3::detail
20 {
21 
22 // ------------------------------------------------------------------
23 // min_viable_uint_t
24 // ------------------------------------------------------------------
25 
27 template <uint64_t value>
28 using min_viable_uint_t = std::conditional_t<value <= 1ull, bool,
29  std::conditional_t<value <= 255ull, uint8_t,
30  std::conditional_t<value <= 65535ull, uint16_t,
32 
35 template <uint64_t value>
36 constexpr auto min_viable_uint_v = static_cast<min_viable_uint_t<value>>(value);
37 
38 // ------------------------------------------------------------------
39 // size_in_values_v
40 // ------------------------------------------------------------------
41 
43 template <std::integral int_t>
44 constexpr size_t size_in_values_v = static_cast<size_t>(std::numeric_limits<int_t>::max()) -
46 
47 } // namespace seqan3::detail
concepts
The Concepts library.
std::numeric_limits::lowest
T lowest(T... args)
std::conditional_t
std::numeric_limits