is_volatile Class
如果型別是動態的測試。
template<class Ty>
struct is_volatile;
參數
- Ty
要查詢的類型。
備註
如果執行個體的型別述詞會保留 true Ty是volatile-qualified。
範例
// std_tr1__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);
}
需求
標頭: <type_traits>
Namespace: 標準