Loading...
Searching...
No Matches
repeat_n.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <concepts>
#include <seqan3/io/views/detail/take_exactly_view.hpp>
#include <seqan3/utility/views/repeat.hpp>
namespace seqan3::detail
{
struct repeat_n_fn
{
template <typename value_t>
constexpr auto operator()(value_t && value, size_t const count) const
{
static_assert(std::copy_constructible<value_t>, "The value passed to repeat_n must be copy constructible.");
return views::repeat(std::forward<value_t>(value)) | detail::take_exactly(count);
}
};
} // namespace seqan3::detail
namespace seqan3::views
{
inline constexpr auto repeat_n = detail::repeat_n_fn{};
} // 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