SeqAn3 3.1.0
The Modern C++ library for sequence analysis.
integer_traits.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2021, 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 <limits>
11#include <type_traits>
12
14
20namespace seqan3::detail
21{
22
23// ------------------------------------------------------------------
24// min_viable_uint_t
25// ------------------------------------------------------------------
26
29template <uint64_t value>
30using min_viable_uint_t = std::conditional_t<value <= 1ull, bool,
31 std::conditional_t<value <= 255ull, uint8_t,
32 std::conditional_t<value <= 65535ull, uint16_t,
34
38template <uint64_t value>
39constexpr auto min_viable_uint_v = static_cast<min_viable_uint_t<value>>(value);
40
41// ------------------------------------------------------------------
42// size_in_values_v
43// ------------------------------------------------------------------
44
47template <typename int_t>
49 requires std::is_integral_v<int_t>
51constexpr size_t size_in_values_v = static_cast<size_t>(std::numeric_limits<int_t>::max()) -
53
54} // namespace seqan3::detail
T max(T... args)
Provides platform and dependency checks.