다음을 통해 공유


function::result_type

The return type of the stored callable object.

typedef Ret result_type;

설명

The typedef is a synonym for the type Ret in the template's call signature. You use it to determine the return type of the wrapped callable object.

예제

 

// std_tr1__functional__function_result_type.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::function<int (int)>::result_type val = fn1(3); 
    std::cout << "val == " << val << std::endl; 
 
    return (0); 
    } 
 
  

요구 사항

헤더: <기능>

네임스페이스: std

참고 항목

참조

function 클래스

function::target_type