kehuadong

c++ type traits

// 移除引用获取原始类型
template <typename _Tp>
struct remove_reference
{
    typedef _Tp type;
};

template <typename _Tp>
struct remove_reference<_Tp &>
{
    typedef _Tp type;
};

template <typename _Tp>
struct remove_reference<_Tp &&>
{
    typedef _Tp type;
};

 

posted on 2024-09-12 21:13  kehuadong  阅读(4)  评论(0编辑  收藏  举报

导航