SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
validate_char_for.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
9
10
#pragma once
11
12
#include <ranges>
13
14
#include <
seqan3/alphabet/concept.hpp
>
15
#include <
seqan3/utility/type_traits/basic.hpp
>
16
#include <
seqan3/utility/views/deep.hpp
>
17
18
namespace
seqan3::views
19
{
69
template
<alphabet alphabet_type>
70
inline
auto
const
validate_char_for
=
deep
{std::views::transform(
71
[]<
typename
char_t>(char_t && in) -> char_t
72
{
73
static_assert
(
74
std::common_reference_with<char_t, alphabet_char_t<alphabet_type>>,
75
"The innermost value type must have a common reference to underlying char type of alphabet_type."
);
76
77
if
(!
char_is_valid_for<alphabet_type>
(in))
78
{
79
throw
seqan3::invalid_char_assignment
{
"alphabet_type"
, in};
80
}
81
return
std::forward<char_t>
(in);
82
})};
83
84
}
// namespace seqan3::views
concept.hpp
Core alphabet concept and free function/type trait wrappers.
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:101
deep.hpp
Provides seqan3::views::deep.
std::forward
T forward(T... args)
seqan3::views::validate_char_for
auto const validate_char_for
An identity view that throws if an encountered character is not valid for the given alphabet.
Definition
validate_char_for.hpp:70
seqan3::char_is_valid_for
constexpr auto char_is_valid_for
Returns whether a character is in the valid set of a seqan3::alphabet (usually implies a bijective ma...
Definition
alphabet/concept.hpp:661
seqan3::views
The SeqAn namespace for views.
Definition
char_strictly_to.hpp:19
seqan3::invalid_char_assignment
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition
alphabet/exception.hpp:27
Hide me
Version:
seqan3
alphabet
views
validate_char_for.hpp
Generated on
for SeqAn3 by
1.17.0