Basically I want to this:
template<typename TYPE>
struct not_rvalue_reference{
typedef std::conditional_t<std::is_rvalue_reference_v<TYPE>, std::remove_reference_t<TYPE>, TYPE> type;
};
template<typename TYPE>
using not_rvalue_reference_t = typename not_rvalue_reference<TYPE>::type;
So for what ever type, I would get either a non reference type or a lvalue reference type.
And I was wondering if such thing exists in the standard library, and if not and I have to use this, what is the best name for it?
Consulting the cppreference documentation for <type_traits>, it appears that there is not such a tool in the standard library. I agree with the commenter 康桓瑋 that
remove_rvalue_referenceis a good name for this. To reduce template instantiation overhead, I would recommend a more direct implementation: