다음을 통해 공유


function::operator()

Calls a callable object.

result_type operator()(T1 t1, T2 t2, ..., TN tN);

매개 변수

  • TN
    The type of the Nth call argument.

  • tN
    The Nth call argument.

설명

The member function returns INVOKE(fn, t1, t2, ..., tN, Ret), where fn is the target object stored in *this. You use it to call the wrapped callable object.

예제

 

// std_tr1__functional__function_operator_call.cpp 
// compile with: /EHsc 
#include <functional> 
#include <iostream> 
 
int neg(int val) 
    { 
    return (-val); 
    } 
 
int main() 
    { 
    std::function<int (int)> fn1(neg); 
    std::cout << std::boolalpha << "empty == " << !fn1 << std::endl; 
    std::cout << "val == " << fn1(3) << std::endl; 
 
    return (0); 
    } 
 
  

요구 사항

헤더: <기능>

네임스페이스: std

참고 항목

참조

function 클래스

function::target