Partager via


reference_wrapper::operator()

Calls the wrapped reference.

template<class T1, class T2, ..., class TN>
    typename result_of<T(T1, T2, ..., TN)>::type
    operator()(T1& t1, T2& t2, ..., TN& tN);

Parameters

  • TN
    The type of the Nth call argument.

  • tN
    The Nth call argument.

Remarks

The template member operator returns INVOKE(get(), t1, t2, ..., tN).

Example

 

// std_tr1__functional__reference_wrapper_operator_call.cpp 
// compile with: /EHsc 
#include <functional> 
#include <iostream> 
 
int neg(int val) 
    { 
    return (-val); 
    } 
 
int main() 
    { 
    std::reference_wrapper<int (int)> rwi(neg); 
 
    std::cout << "rwi(3) = " << rwi(3) << std::endl; 
 
    return (0); 
    } 
 
rwi(3) = -3

Requirements

Header: <functional>

Namespace: std

See Also

Reference

reference_wrapper Class

reference_wrapper::get