SeqAn3  3.0.2
The Modern C++ library for sequence analysis.
char_to.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 
13 #pragma once
14 
18 #include <seqan3/std/ranges>
19 
20 namespace seqan3::views
21 {
22 
68 template <alphabet alphabet_type>
69 inline auto const char_to = deep{std::views::transform([] (auto && in)
70 {
71  static_assert(std::common_reference_with<decltype(in), alphabet_char_t<alphabet_type>>,
72  "The innermost value type must have a common reference to underlying char type of alphabet_type.");
73  // call element-wise assign_char from the alphabet
74  return assign_char_to(in, alphabet_type{});
75 })};
76 
78 
79 } // namespace seqan3::views
seqan3::views
The SeqAn namespace for views.
Definition: view_iota_simd.hpp:218
seqan3::views::char_to
auto const char_to
A view over an alphabet, given a range of characters.
Definition: char_to.hpp:69
basic.hpp
Provides various type traits on generic types.
seqan3::views::deep
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition: deep.hpp:102
seqan3::alphabet_char_t
decltype(seqan3::to_char(std::declval< alphabet_type const >())) alphabet_char_t
The char_type of the alphabet; defined as the return type of seqan3::to_char.
Definition: concept.hpp:330
ranges
Adaptations of concepts from the Ranges TS.
deep.hpp
Provides seqan3::views::deep.
seqan3::assign_char_to
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition: concept.hpp:417
seqan3::pack_traits::transform
seqan3::type_list< trait_t< pack_t >... > transform
Apply a transformation trait to every type in the pack and return a seqan3::type_list of the results.
Definition: traits.hpp:307
concept.hpp
Core alphabet concept and free function/type trait wrappers.