add_reference Class
Fa riferimento al tipo di tipo.
template<class Ty>
struct add_reference;
Parametri
- Ty
il tipo da modificare.
Note
Un'istanza del modificatore di tipo utilizza un modificare-tipo che viene Ty se Ty è un riferimento in caso contrario, Ty&.
Esempio
// std_tr1__type_traits__add_reference.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>
int main()
{
int val = 0;
std::add_reference<int>::type p = (int&)val;
p = p; // to quiet "unused" warning
std::cout << "add_reference<int> == "
<< typeid(p).name() << std::endl;
return (0);
}
Requisiti
intestazione: <type_traits>
Spazio dei nomi: deviazione standard