Udostępnij za pośrednictwem


remove_cv Class

Makes non const/volatile type from type.

template<class Ty>
    struct remove_cv;

Parameters

  • Ty
    The type to modify.

Remarks

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

Example

 

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

Requirements

Header: <type_traits>

Namespace: std

See Also

Reference

<type_traits>

remove_const Class

remove_volatile Class

Other Resources

<type_traits> Members