description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||
---|---|---|---|---|---|---|---|---|
Learn more about: add_volatile Class | add_volatile Class | 11/04/2016 |
|
| cde57277-d764-402d-841e-97611ebaab14 |
Makes a volatile
type from the specified type.
template <classTy> structadd_volatile; template <classT> usingadd_volatile_t = typename add_volatile<T>::type;
T
The type to modify.
An instance of add_volatile<T>
has a member typedef
type
that is T if T is a reference, a function, or a volatile-qualified type, otherwise volatile
T. The alias add_volatile_t
is a shortcut to access the member typedef
type
.
#include<type_traits> #include<iostream>intmain() { std::add_volatile_t<int> *p = (volatileint *)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