We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

add_cv Class

Makes const/volatile type from type.

template<class Ty>
    struct add_cv;


The type to modify.

An instance of the type modifier holds the modified-type add_volatile Class< add_const Class<Ty> >.


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

Header: <type_traits>

Namespace: std::tr1