SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
elements.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/utility/tuple/concept.hpp
>
15
#include <
seqan3/utility/type_traits/basic.hpp
>
16
17
namespace
seqan3::views
18
{
76
template
<auto index>
77
inline
constexpr
auto
elements
= std::views::transform(
78
[](
auto
&& in) ->
decltype
(
auto
)
79
{
80
using
std::get;
81
using
seqan3::get
;
82
83
using
element_t =
decltype
(in);
84
85
static_assert
(
tuple_like<element_t>
,
86
"You may only pass ranges to views::element_t whose reference_t models tuple_like."
);
87
88
// we need to explicitly remove && around temporaries to return values as values (and not as rvalue references)
89
// we cannot simply cast to std::tuple_element_t (or set that as return value), because some tuples, like
90
// our alphabet_tuple_base alphabets do not return that type when get is called on them (they return a proxy)
91
using
ret_type = remove_rvalue_reference_t<decltype(get<index>(
std::forward<element_t>
(in)))>;
92
return
static_cast<
ret_type
>
(
get<index>
(
std::forward<element_t>
(in)));
93
});
94
95
}
// namespace seqan3::views
basic.hpp
Provides various type traits on generic types.
std::forward
T forward(T... args)
seqan3::views::elements
constexpr auto elements
A view calling get on each element in a range.
Definition
elements.hpp:77
tuple_like
Whether a type behaves like a tuple.
seqan3::views
The SeqAn namespace for views.
Definition
char_strictly_to.hpp:19
seqan3::get
constexpr auto const & get(configuration< configs_t... > const &config) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition
configuration.hpp:412
concept.hpp
Provides seqan3::tuple_like.
Hide me
Version:
seqan3
utility
views
elements.hpp
Generated on
for SeqAn3 by
1.17.0