Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions libcxx/include/__type_traits/copy_cvref.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _From, class _To>
template <class _From>
struct __copy_cvref {
using type = __copy_cv_t<_From, _To>;
template <class _To>
using __apply _LIBCPP_NODEBUG = __copy_cv_t<_From, _To>;
};

template <class _From, class _To>
struct __copy_cvref<_From&, _To> {
using type = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >;
template <class _From>
struct __copy_cvref<_From&> {
template <class _To>
using __apply _LIBCPP_NODEBUG = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >;
};

template <class _From, class _To>
struct __copy_cvref<_From&&, _To> {
using type = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >;
template <class _From>
struct __copy_cvref<_From&&> {
template <class _To>
using __apply _LIBCPP_NODEBUG = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >;
};

template <class _From, class _To>
using __copy_cvref_t _LIBCPP_NODEBUG = typename __copy_cvref<_From, _To>::type;
using __copy_cvref_t _LIBCPP_NODEBUG = typename __copy_cvref<_From>::template __apply<_To>;

_LIBCPP_END_NAMESPACE_STD

Expand Down
Loading