SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
alphabet/detail/convert.hpp
Go to the documentation of this file.
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
12#pragma once
13
14#include <array>
15
17
18// ============================================================================
19// conversion to/from char/rank types
20// ============================================================================
21
22namespace seqan3::detail
23{
24
31template <typename in_t, typename out_t>
34 []() constexpr
35 {
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
Provides alphabet helper concepts.
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition alphabet/concept.hpp:517
constexpr auto to_char
Return the char representation of an alphabet object.
Definition alphabet/concept.hpp:381
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition alphabet/concept.hpp:288
constexpr std::array< out_t, alphabet_size< in_t > > convert_through_char_representation
A precomputed conversion table for two alphabets based on their char representations.
Definition alphabet/detail/convert.hpp:33
Checks whether from_t can be converted through to_t using their char representation.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Hide me