function::operator()

호출 하는 개체를 호출합니다.

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

매개 변수

  • TN
    N 번째의 형식 인수를 호출 합니다.

  • tN
    N 번째 호출 인수입니다.

설명

멤버 함수를 반환 합니다. INVOKE(fn, t1, t2, ..., tN, Ret)여기서 fn 대상 개체에 저장 된 *this.래핑된 개체를 호출할 수 호출에 사용 합니다.

예제

 

// 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); 
    } 
 
  

요구 사항

헤더: <functional>

네임 스페이스: std

참고 항목

참조

function Class

function::target