SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
transfer_type_modifier_onto.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 
13 #pragma once
14 
15 #include <seqan3/std/type_traits>
16 
17 #include <seqan3/core/platform.hpp>
18 
19 namespace seqan3::detail
20 {
21 
33 template <typename source_t, typename target_t>
34 struct transfer_type_modifier_onto
35 {
36 private:
39  std::is_const_v<std::remove_reference_t<target_t>>,
42 
44  using maybe_rvalue_reference_t = std::conditional_t<std::is_rvalue_reference_v<source_t> ||
45  std::is_rvalue_reference_v<target_t>,
47  maybe_const_target_t>;
48 
50  using maybe_lvalue_reference_target_t = std::conditional_t<std::is_lvalue_reference_v<source_t> ||
51  std::is_lvalue_reference_v<target_t>,
53  maybe_rvalue_reference_t>;
54 public:
55 
57  using type = maybe_lvalue_reference_target_t;
58 };
59 
67 template <typename source_t, typename target_t>
68 using transfer_type_modifier_onto_t = typename transfer_type_modifier_onto<source_t, target_t>::type;
69 
70 } // namespace seqan3::detail
Provides platform and dependency checks.
Provides C++20 additions to the type_traits header.