SeqAn3  3.2.0
The Modern C++ library for sequence analysis.
transfer_type_modifier_onto.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 
15 #include <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>>,
41  std::remove_cvref_t<target_t>>;
42 
44  using maybe_rvalue_reference_t =
45  std::conditional_t<std::is_rvalue_reference_v<source_t> || std::is_rvalue_reference_v<target_t>,
47  maybe_const_target_t>;
48 
50  using maybe_lvalue_reference_target_t =
51  std::conditional_t<std::is_lvalue_reference_v<source_t> || std::is_lvalue_reference_v<target_t>,
53  maybe_rvalue_reference_t>;
54 
55 public:
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.