remove_cv — Klasa
Tworzy typ inny niż const/volatile z typu.
Składnia
template <class T>
struct remove_cv;
template <class T>
using remove_cv_t = typename remove_cv<T>::type;
Parametry
T
Typ do modyfikacji.
Uwagi
Wystąpienie remove_cv<T>
obiektu przechowuje zmodyfikowany typ, który występuje T1
, gdy T ma postać const T1
, volatile T1
lub , w const volatile T1
przeciwnym razie T.
Przykład
#include <type_traits>
#include <iostream>
int main()
{
int *p = (std::remove_cv_t<const volatile int> *)0;
p = p; // to quiet "unused" warning
std::cout << "remove_cv_t<const volatile int> == "
<< typeid(*p).name() << std::endl;
return (0);
}
remove_cv_t<const volatile int> == int
Wymagania
Nagłówek:<type_traits>
Przestrzeń nazw: std