SeqAn3 3.3.0-rc.1
The Modern C++ library for sequence analysis.
adaptor_for_view_without_args.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2022, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6// -----------------------------------------------------------------------------------------------------
7
13#pragma once
14
16
17namespace seqan3::detail
18{
19
20// ============================================================================
21// adaptor_for_view_without_args
22// ============================================================================
23
47template <template <typename, typename...> typename view_type>
48class adaptor_for_view_without_args : public adaptor_base<adaptor_for_view_without_args<view_type>>
49{
50private:
53
55 friend base_type;
56
63 template <typename... arg_types>
64 static auto impl(arg_types &&... args)
65 {
66 return view_type{std::forward<arg_types>(args)...};
67 }
68
69public:
74 constexpr adaptor_for_view_without_args() = default;
76 constexpr adaptor_for_view_without_args(adaptor_for_view_without_args const &) noexcept = default;
80 constexpr adaptor_for_view_without_args & operator=(adaptor_for_view_without_args const &) noexcept = default;
82 constexpr adaptor_for_view_without_args & operator=(adaptor_for_view_without_args &&) noexcept = default;
84 ~adaptor_for_view_without_args() noexcept = default;
85
87 using base_type::base_type;
89};
90
91} // 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:77
Template for range adaptor closure objects that store no arguments and always delegate to the view co...
Definition: adaptor_for_view_without_args.hpp:49
constexpr adaptor_for_view_without_args(adaptor_for_view_without_args const &) noexcept=default
Defaulted.
friend base_type
Befriend the base class so it can call impl().
Definition: adaptor_for_view_without_args.hpp:55
static auto impl(arg_types &&... args)
Call the view's constructor with the given arguments (all of the base class'es operators ultimately r...
Definition: adaptor_for_view_without_args.hpp:64
constexpr adaptor_for_view_without_args(adaptor_for_view_without_args &&) noexcept=default
Defaulted.
constexpr adaptor_for_view_without_args()=default
Defaulted.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29