SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
alphabet/detail/convert.hpp
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
11
12
#pragma once
13
14
#include <
array
>
15
16
#include <
seqan3/alphabet/detail/concept.hpp
>
17
18
// ============================================================================
19
// conversion to/from char/rank types
20
// ============================================================================
21
22
namespace
seqan3::detail
23
{
24
31
template
<
typename
in_t,
typename
out_t>
32
requires
convertable_to_through_char_representation<in_t, out_t>
33
constexpr
std::array<out_t, alphabet_size<in_t>> convert_through_char_representation{
34
[]()
constexpr
35
{
36
std::array<out_t, alphabet_size<in_t>> ret{};
37
38
// for (decltype(alphabet_size<in_t>) i = 0; ...) causes indefinite compilation :(
39
for
(
auto
i =
decltype
(
alphabet_size<in_t>
){0}; i < alphabet_size<in_t>; ++i)
40
assign_char_to
(
to_char
(
assign_rank_to
(i, in_t{})), ret[i]);
41
42
return
ret;
43
}()};
44
45
}
// namespace seqan3::detail
concept.hpp
Provides alphabet helper concepts.
array
seqan3::assign_char_to
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition
alphabet/concept.hpp:517
seqan3::to_char
constexpr auto to_char
Return the char representation of an alphabet object.
Definition
alphabet/concept.hpp:381
seqan3::alphabet_size
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition
alphabet/concept.hpp:834
seqan3::assign_rank_to
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition
alphabet/concept.hpp:288
Hide me
Version:
seqan3
alphabet
detail
convert.hpp
Generated on
for SeqAn3 by
1.17.0