reference_wrapper::result_type
封裝的參考弱式結果型別。
typedef T0 result_type;
備註
typedef 是包裝函式的弱式結果型別的同義字。
範例
// std_tr1__functional__reference_wrapper_result_type.cpp
// compile with: /EHsc
#include <functional>
#include <iostream>
int neg(int val)
{
return (-val);
}
int main()
{
typedef std::reference_wrapper<int (int)> Mywrapper;
Mywrapper rwi(neg);
Mywrapper::result_type val = rwi(3);
std::cout << "val = " << val << std::endl;
return (0);
}
需求
標題: <functional>
命名空間: std