SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
adaptor_from_functor.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
10#pragma once
11
13
14namespace seqan3::detail
15{
16
17// ============================================================================
18// adaptor_from_functor
19// ============================================================================
20
51template <typename functor_type, typename... stored_args_ts>
53 public adaptor_base<adaptor_from_functor<functor_type, stored_args_ts...>, stored_args_ts...>
54{
55private:
58
60 friend base_type;
61
64
72 template <std::ranges::input_range urng_t>
73 constexpr auto impl(urng_t && urange, stored_args_ts... args) const
74 {
75 return fun(std::forward<urng_t>(urange), std::forward<stored_args_ts>(args)...);
76 }
77
78public:
82 constexpr adaptor_from_functor() = default;
83 constexpr adaptor_from_functor(adaptor_from_functor const &) noexcept = default;
88
91 base_type{std::forward<stored_args_ts>(args)...},
92 fun{std::move(f)}
93 {}
95};
96
97} // namespace seqan3::detail
Provides seqan3::detail::adaptor_base and seqan3::detail::combined_adaptor.
CRTP-base to simplify the definition of range adaptor closure objects and similar types.
Definition adaptor_base.hpp:74
Template for range adaptor closure objects that store arguments and wrap a proto-adaptor.
Definition adaptor_from_functor.hpp:54
functor_type fun
The stored functor, usually a "proto-adaptor".
Definition adaptor_from_functor.hpp:63
friend base_type
Befriend the base class so it can call impl().
Definition adaptor_from_functor.hpp:60
constexpr adaptor_from_functor(adaptor_from_functor const &) noexcept=default
Defaulted.
constexpr adaptor_from_functor()=default
Defaulted.
constexpr adaptor_from_functor(adaptor_from_functor &&) noexcept=default
Defaulted.
constexpr auto impl(urng_t &&urange, stored_args_ts... args) const
Delegate the range argument and stored arguments to the wrapped functor.
Definition adaptor_from_functor.hpp:73
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
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
Hide me