Loading...
Searching...
No Matches
adaptor_from_functor.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 <seqan3/core/range/detail/adaptor_base.hpp>
namespace seqan3::detail
{
// ============================================================================
// adaptor_from_functor
// ============================================================================
template <typename functor_type, typename... stored_args_ts>
class adaptor_from_functor :
public adaptor_base<adaptor_from_functor<functor_type, stored_args_ts...>, stored_args_ts...>
{
private:
using base_type = adaptor_base<adaptor_from_functor<functor_type, stored_args_ts...>, stored_args_ts...>;
friend base_type;
functor_type fun;
template <std::ranges::input_range urng_t>
constexpr auto impl(urng_t && urange, stored_args_ts... args) const
{
return fun(std::forward<urng_t>(urange), std::forward<stored_args_ts>(args)...);
}
public:
constexpr adaptor_from_functor() = default;
constexpr adaptor_from_functor(adaptor_from_functor const &) noexcept = default;
constexpr adaptor_from_functor(adaptor_from_functor &&) noexcept = default;
constexpr adaptor_from_functor & operator=(adaptor_from_functor const &) noexcept = default;
constexpr adaptor_from_functor & operator=(adaptor_from_functor &&) noexcept = default;
~adaptor_from_functor() noexcept = default;
constexpr adaptor_from_functor(functor_type f, stored_args_ts... args) :
base_type{std::forward<stored_args_ts>(args)...},
fun{std::move(f)}
{}
};
} // namespace seqan3::detail
adaptor_base.hpp
Provides seqan3::detail::adaptor_base and seqan3::detail::combined_adaptor.
std::forward
T forward(T... args)
Hide me