add_const – třída
Díky const typ od typu.
template<class Ty>
struct add_const;
Parametry
- Ty
Typ chcete změnit.
Poznámky
Obsahuje instanci typu modifikátor upravena typ, který je Ty -li Ty je odkaz, funkce nebo typu const kvalifikovaný, jinak const Ty.
Příklad
// std_tr1__type_traits__add_const.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
int main()
{
std::add_const<int>::type *p = (const int *)0;
p = p; // to quiet "unused" warning
std::cout << "add_const<int> == "
<< typeid(*p).name() << std::endl;
return (0);
}
Požadavky
Záhlaví: <type_traits>
Obor názvů: std