libcp/src/include/stl/remove_cvref.hpp

29 lines
690 B
C++

#ifndef _H_LIBCP_STL_REMOVE_CVREF
#define _H_LIBCP_STL_REMOVE_CVREF
#include <stl/is_same.hpp>
// For gcc
// template <class _Tp>
// struct __remove_cvref_gcc {
// using type = __remove_cvref(_Tp);
// };
// template <class _Tp>
// using __remove_cvref_t _LIBCPP_NODEBUG = typename __remove_cvref_gcc<_Tp>::type;
template <class _Tp>
using __remove_cvref_t = __remove_cvref(_Tp);
template <class _Tp, class _Up>
using __is_same_uncvref = is_same<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up>>;
template <class _Tp>
struct remove_cvref {
using type = __remove_cvref(_Tp);
};
template <class _Tp>
using remove_cvref_t = __remove_cvref_t<_Tp>;
#endif // _H_LIBCP_STL_REMOVE_CVREF