Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
remove_cv Class
Collapse the table of content
Expand the table of content

remove_cv Class

Makes non const/volatile type from type.

template<class T>
    struct remove_cv;

template<class T>
  using remove_cv_t = typename remove_cv<T>::type;

T

The type to modify.

An instance of remove_cv<T> holds a modified-type that is T1 when T is of the form const T1, volatile T1, or const volatile T1, otherwise T.

 

 
#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    int *p = (std::remove_cv_t<const volatile int> *)0; 
 
    p = p;  // to quiet "unused" warning 
    std::cout << "remove_cv_t<const volatile int> == " 
        << typeid(*p).name() << std::endl; 
 
    return (0); 
    } 
 
remove_cv_t<const volatile int> == int

Header: <type_traits>

Namespace: std

Show:
© 2015 Microsoft