is_volatile-Klasse
Testet, ob der Typ flüchtig ist.
Syntax
template <class Ty>
struct is_volatile;
Parameter
Ty
Der abzufragende Typ.
Hinweise
Eine Instanz des Typprädikats enthält "true", wenn Ty ist volatile-qualified
.
Beispiel
// std__type_traits__is_volatile.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
struct trivial
{
int val;
};
int main()
{
std::cout << "is_volatile<trivial> == " << std::boolalpha
<< std::is_volatile<trivial>::value << std::endl;
std::cout << "is_volatile<volatile trivial> == " << std::boolalpha
<< std::is_volatile<volatile trivial>::value << std::endl;
std::cout << "is_volatile<int> == " << std::boolalpha
<< std::is_volatile<int>::value << std::endl;
std::cout << "is_volatile<volatile int> == " << std::boolalpha
<< std::is_volatile<volatile int>::value << std::endl;
return (0);
}
is_volatile<trivial> == false
is_volatile<volatile trivial> == true
is_volatile<int> == false
is_volatile<volatile int> == true
Anforderungen
Header:<type_traits>
Namespace: std