Share via


reference_wrapper::type

The type of the wrapped reference.

typedef Ty type;

Remarks

The typedef is a synonym for the template argument Ty.

Example

 

// std_tr1__functional__reference_wrapper_type.cpp 
// compile with: /EHsc 
#include <functional> 
#include <iostream> 
 
int neg(int val) 
    { 
    return (-val); 
    } 
 
int main() 
    { 
    int i = 1; 
    typedef std::reference_wrapper<int> Mywrapper; 
    Mywrapper rwi(i); 
    Mywrapper::type val = rwi.get(); 
 
    std::cout << "i = " << i << std::endl; 
    std::cout << "rwi = " << val << std::endl; 
 
    return (0); 
    } 
 
i = 1
rwi = 1

Requirements

Header: <functional>

Namespace: std

See Also

Reference

reference_wrapper Class

reference_wrapper::result_type