remove_const — Klasa
Tworzy typ niestały z typu.
template<class T>
struct remove_const;
template<class T>
using remove_const_t = typename remove_const<T>::type;
Parametry
- T
Typ do modyfikacji.
Uwagi
Wystąpienie remove_const<T> ma zmodyfikowany typ T1, gdy T ma postać const T1, w przeciwnym razie T.
Przykład
#include <type_traits>
#include <iostream>
int main()
{
int *p = (std::remove_const_t<const int>*)0;
p = p; // to quiet "unused" warning
std::cout << "remove_const_t<const int> == "
<< typeid(*p).name() << std::endl;
return (0);
}
Wymagania
Nagłówek: <type_traits>
Przestrzeń nazw: std