GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::remove_cvref(3) C++ Standard Libary std::remove_cvref(3)

std::remove_cvref - std::remove_cvref


Defined in header <type_traits>
template< class T > (since C++20)
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.


The behavior of a program that adds specializations for remove_cvref is undefined.


Name Definition
type the type referred by T or T itself if it is not a reference, with top-level
cv-qualifiers removed


template< class T > (since C++20)
using remove_cvref_t = typename remove_cvref<T>::type;


template< class T >
struct remove_cvref {
typedef std::remove_cv_t<std::remove_reference_t<T>> type;
};


Feature-test macro: __cpp_lib_remove_cvref

// Run this code


#include <iostream>
#include <type_traits>


int main()
{
std::cout << std::boolalpha
<< std::is_same_v<std::remove_cvref_t<int>, int> << '\n'
<< std::is_same_v<std::remove_cvref_t<int&>, int> << '\n'
<< std::is_same_v<std::remove_cvref_t<int&&>, int> << '\n'
<< std::is_same_v<std::remove_cvref_t<const int&>, int> << '\n'
<< std::is_same_v<std::remove_cvref_t<const int[2]>, int[2]> << '\n'
<< std::is_same_v<std::remove_cvref_t<const int(&)[2]>, int[2]> << '\n'
<< std::is_same_v<std::remove_cvref_t<int(int)>, int(int)> << '\n';
}


true
true
true
true
true
true
true


remove_cv
remove_const
remove_volatile removes const or/and volatile specifiers from the given type
(C++11) (class template)
(C++11)
(C++11)
remove_reference removes a reference from the given type
(C++11) (class template)
decay applies type transformations as when passing a function argument by
(C++11) value
(class template)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.