Export (0) Print
Expand All
Expand Minimize

add_cv Class

Makes const/volatile type from type.

template<class Ty>
    struct add_cv;

template<class T>
using add_cv_t = typename add_cv<T>::type;

Ty

The type to modify.

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

 

#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    std::add_cv_t<int> *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_t<int> == int

Header: <type_traits>

Namespace: std

Show:
© 2014 Microsoft