reference_wrapper::get
Obtient la référence encapsulée.
Ty& get() const;
Notes
La fonction membre retourne INVOKE(get(), t1, t2, ..., tN).
Exemple
// std_tr1__functional__reference_wrapper_get.cpp
// compile with: /EHsc
#include <functional>
#include <iostream>
int main()
{
int i = 1;
std::reference_wrapper<int> rwi(i);
std::cout << "i = " << i << std::endl;
std::cout << "rwi = " << rwi << std::endl;
rwi.get() = -1;
std::cout << "i = " << i << std::endl;
return (0);
}
Configuration requise
en-tête : <functional>
l'espace de noms : DST