다음을 통해 공유


reference_wrapper::operator Ty&

Gets a pointer to the wrapped reference.

operator Ty&() const;

Remarks

The member operator returns *ptr.

Example

 

// std_tr1__functional__reference_wrapper_operator_cast.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 << "(int)rwi = " << (int)rwi << std::endl; 
 
    return (0); 
    } 
 
i = 1
(int)rwi = 1

Requirements

Header: <functional>

Namespace: std

See Also

Reference

reference_wrapper Class

reference_wrapper::operator()