Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

remove_const Class

Makes non const type from type.

template<class Ty>
    struct remove_const;

Ty

The type to modify.

An instance of the type modifier holds a modified-type that is Ty1 when Ty is of the form const Ty1, otherwise Ty.

 

// std_tr1__type_traits__remove_const.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    int *p = (std::tr1::remove_const<const int>::type *)0; 
 
    p = p;  // to quiet "unused" warning 
    std::cout << "remove_const<const int> == " 
        << typeid(*p).name() << std::endl; 
 
    return (0); 
    } 
 
remove_const<const int> == int

Header: <type_traits>

Namespace: std::tr1

Community Additions

ADD
Show:
© 2015 Microsoft