Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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); 
    } 
 
empty == false
val == -3

Header: <functional>

Namespace: std

Community Additions

Show:
© 2016 Microsoft