reference_wrapper::operator Ty&

ラップされた参照へのポインターを取得します。

operator Ty&() const;

解説

このメンバー演算子は、*ptr を返します。

使用例

 

// std_tr1__functional__reference_wrapper_operator_cast.cpp 
// compile with: /EHsc 
#include <functional> 
#include <iostream> 
 
int main() 
    { 
    int i = 1; 
    std::reference_wrapper<int> rwi(i); 
 
    std::cout << "i = " << i << std::endl; 
    std::cout << "(int)rwi = " << (int)rwi << std::endl; 
 
    return (0); 
    } 
 
  

必要条件

ヘッダー : <functional>

名前空間: std

参照

関連項目

reference_wrapper クラス

reference_wrapper::operator()