SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
as_const.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, 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 
14 #pragma once
15 
16 #include <seqan3/std/ranges>
17 
19 
20 #ifdef SEQAN3_DEPRECATED_310
21 
22 namespace seqan3::detail
23 {
24 
26 struct as_const_fn_deprecated
27 {
29  template <typename t>
30  t operator()(t const && arg) const
31  {
32  return std::move(arg);
33  }
34 
36  template <typename t>
37  t const & operator()(t const & arg) const
38  {
39  return arg;
40  }
41 };
42 
43 } // namespace seqan3::detail
44 
45 namespace seqan3::views
46 {
47 
93 SEQAN3_DEPRECATED_310 inline constexpr auto as_const = std::views::transform(seqan3::detail::as_const_fn_deprecated{});
95 
96 } // namespace seqan3::views
97 
98 #endif // SEQAN3_DEPRECATED_310
Provides various type traits for use on functions.
decltype(detail::transform< trait_t >(list_t{})) transform
Apply a transformation trait to every type in the list and return a seqan3::type_list of the results.
Definition: traits.hpp:471
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:74
constexpr auto as_const
A view that provides only const & to elements of the underlying range.
Definition: as_const.hpp:93
The SeqAn namespace for views.
Definition: char_to.hpp:22
#define SEQAN3_DEPRECATED_310
Deprecation message for SeqAn 3.1.0 release.
Definition: platform.hpp:203
Adaptations of concepts from the Ranges TS.