SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
repeat_n.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 <concepts>
13
14
#include <
seqan3/io/views/detail/take_exactly_view.hpp
>
15
#include <
seqan3/utility/views/repeat.hpp
>
16
17
namespace
seqan3::detail
18
{
19
25
struct
repeat_n_fn
26
{
33
template
<
typename
value_t>
34
constexpr
auto
operator()(value_t && value,
size_t
const
count)
const
35
{
36
static_assert
(std::copy_constructible<value_t>,
"The value passed to repeat_n must be copy constructible."
);
37
38
return
views::repeat
(
std::forward<value_t>
(value)) | detail::take_exactly(count);
39
}
40
};
41
42
}
// namespace seqan3::detail
43
44
namespace
seqan3::views
45
{
88
inline
constexpr
auto
repeat_n
= detail::repeat_n_fn{};
89
90
}
// namespace seqan3::views
std::forward
T forward(T... args)
seqan3::views::repeat
constexpr detail::repeat_fn repeat
A view factory that repeats a given value infinitely.
Definition
repeat.hpp:344
seqan3::views::repeat_n
constexpr auto repeat_n
A view factory that repeats a given value n times.
Definition
repeat_n.hpp:88
seqan3::views
The SeqAn namespace for views.
Definition
char_strictly_to.hpp:19
repeat.hpp
Provides the seqan3::views::repeat.
take_exactly_view.hpp
Provides seqan3::views::take_exactly and seqan3::views::take_exactly_or_throw.
Hide me
Version:
seqan3
utility
views
repeat_n.hpp
Generated on
for SeqAn3 by
1.17.0