template< class T >
struct remove_cvref;
If the type T
is a reference type, provides the member typedef type
which is the type referred to by T
with its topmost cv-qualifiers removed. Otherwise type
is T
with its topmost cv-qualifiers removed.
If the program adds specializations for std::remove_cvref
, the behavior is undefined.
type
the type referred by T
or T
itself if it is not a reference, with top-level cv-qualifiers removed [edit] Helper types
template< class T >
using remove_cvref_t = remove_cvref<T>::type;
#include <type_traits> int main() { static_assert(std::is_same_v<std::remove_cvref_t<int>, int>); static_assert(std::is_same_v<std::remove_cvref_t<int&>, int>); static_assert(std::is_same_v<std::remove_cvref_t<int&&>, int>); static_assert(std::is_same_v<std::remove_cvref_t<const int&>, int>); static_assert(std::is_same_v<std::remove_cvref_t<const int[2]>, int[2]>); static_assert(std::is_same_v<std::remove_cvref_t<const int(&)[2]>, int[2]>); static_assert(std::is_same_v<std::remove_cvref_t<int(int)>, int(int)>); }[edit] See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4