remove_cv Class
由型別進行非 const 或 volatile 型別。
template<class Ty>
struct remove_cv;
參數
- Ty
修改的型別。
備註
這個型別修飾詞的執行個體所持有的修改型別是 Ty1 ,當 Ty 是表單 const Ty1、 volatile Ty1或 const volatile Ty1時,則為 Ty。
範例
// std_tr1__type_traits__remove_cv.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
int main()
{
int *p = (std::remove_cv<const volatile int>::type *)0;
p = p; // to quiet "unused" warning
std::cout << "remove_cv<const volatile int> == "
<< typeid(*p).name() << std::endl;
return (0);
}
需求
標題: <type_traits>
命名空間: std