remove_volatile Class
Makes non volatile type from type.
Syntax
template <class T>
struct remove_volatile;
template <class T>
using remove_volatile_t = typename remove_volatile<T>::type;
Parameters
T
The type to modify.
Remarks
An instance of remove_volatile<T>
holds a modified-type that is T1
when T is of the form volatile T1
, otherwise T.
Example
#include <type_traits>
#include <iostream>
int main()
{
int *p = (std::remove_volatile_t<volatile int> *)0;
p = p; // to quiet "unused" warning
std::cout << " remove_volatile_t<volatile int> == "
<< typeid(*p).name() << std::endl;
return (0);
}
remove_volatile_t<volatile int> == int
Requirements
Header: <type_traits>
Namespace: std
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for