Loading...
Searching...
No Matches
transfer_type_modifier_onto.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <type_traits>
#include <seqan3/core/platform.hpp>
namespace seqan3::detail
{
template <typename source_t, typename target_t>
struct transfer_type_modifier_onto
{
private:
using maybe_const_target_t = std::conditional_t<std::is_const_v<std::remove_reference_t<source_t>>
|| std::is_const_v<std::remove_reference_t<target_t>>,
std::add_const_t<std::remove_cvref_t<target_t>>,
std::remove_cvref_t<target_t>>;
using maybe_rvalue_reference_t =
std::conditional_t<std::is_rvalue_reference_v<source_t> || std::is_rvalue_reference_v<target_t>,
std::add_rvalue_reference_t<maybe_const_target_t>,
maybe_const_target_t>;
using maybe_lvalue_reference_target_t =
std::conditional_t<std::is_lvalue_reference_v<source_t> || std::is_lvalue_reference_v<target_t>,
std::add_lvalue_reference_t<maybe_rvalue_reference_t>,
maybe_rvalue_reference_t>;
public:
using type = maybe_lvalue_reference_target_t;
};
template <typename source_t, typename target_t>
using transfer_type_modifier_onto_t = typename transfer_type_modifier_onto<source_t, target_t>::type;
} // namespace seqan3::detail
std::is_const_v
T is_const_v
std::is_lvalue_reference_v
T is_lvalue_reference_v
std::is_rvalue_reference_v
T is_rvalue_reference_v
platform.hpp
Provides platform and dependency checks.
type_traits
Hide me