Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 1.24 KB

add-volatile-class.md

File metadata and controls

63 lines (44 loc) · 1.24 KB
descriptiontitlems.datef1_keywordshelpviewer_keywordsms.assetid
Learn more about: add_volatile Class
add_volatile Class
11/04/2016
type_traits/std::add_volatile
add_volatile class
add_volatile
cde57277-d764-402d-841e-97611ebaab14

add_volatile Class

Makes a volatile type from the specified type.

Syntax

template <classTy> structadd_volatile; template <classT> usingadd_volatile_t = typename add_volatile<T>::type;

Parameters

T
The type to modify.

Remarks

An instance of add_volatile<T> has a member typedeftype that is T if T is a reference, a function, or a volatile-qualified type, otherwise volatileT. The alias add_volatile_t is a shortcut to access the member typedeftype.

Example

#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 

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
remove_volatile Class

close