This documentation is archived and is not being maintained.

add_volatile Class

Makes volatile type from the specified type.

template<class Ty>
    struct add_volatile;


The type to modify.

An instance of the type modifier holds a modified-type that is Ty if Ty is a reference, a function, or a volatile-qualified type, otherwise volatile Ty.


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

Header: <type_traits>

Namespace: std