remove_const Class
is_null_pointer Class
is_trivial Class
is_trivially_copyable Class
TOC
Collapse the table of content
Expand the table of content

remove_const Class

 

Makes a non const type from type.

template<class T>
    struct remove_const;
template<class T>
  using remove_const_t = typename remove_const<T>::type;

T

The type to modify.

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

Example

 

#include <type_traits> 
#include <iostream> 

int main() 
    { 
    int *p = (std::remove_const_t<const int>*)0; 

    p = p;  // to quiet "unused" warning 
    std::cout << "remove_const_t<const int> == " 
        << typeid(*p).name() << std::endl; 

    return (0); 
    } 

remove_const_t<const int> == int

Requirements

Header: <type_traits>

Namespace: std

Show:
© 2016 Microsoft