xieite ::cp_ref <>
Defined in header <xieite/trait/cp_ref.hpp>
Copies the references of one type to another.
Declaration
template <typename T ,typename U >using cp_ref =std ::conditional_t <xieite ::is_lref <T >,xieite ::add_lref <U >,xieite ::cp_rref <T ,xieite ::rm_ref <U >>>;
Example
[View in Compiler Explorer]static_assert (std ::same_as <xieite ::cp_ref <int ,int >,int >);static_assert (std ::same_as <xieite ::cp_ref <int ,int& >,int >);static_assert (std ::same_as <xieite ::cp_ref <int ,int&& >,int >);static_assert (std ::same_as <xieite ::cp_ref <int& ,int >,int& >);static_assert (std ::same_as <xieite ::cp_ref <int& ,int& >,int& >);static_assert (std ::same_as <xieite ::cp_ref <int& ,int&& >,int& >);static_assert (std ::same_as <xieite ::cp_ref <int&& ,int >,int&& >);static_assert (std ::same_as <xieite ::cp_ref <int&& ,int& >,int&& >);static_assert (std ::same_as <xieite ::cp_ref <int&& ,int&& >,int&& >);