名前空間
変種
操作

std::mem_fun_t, std::mem_fun1_t, std::const_mem_fun_t, std::const_mem_fun1_t

From cppreference.com
< cpp‎ | utility‎ | functional
 
 
ユーティリティライブラリ
言語サポート
型のサポート (基本型、RTTI)
ライブラリ機能検査マクロ (C++20)
プログラムユーティリティ
可変引数関数
コルーチンサポート (C++20)
契約サポート (C++26)
三方比較
(C++20)
(C++20)(C++20)(C++20)  
(C++20)(C++20)(C++20)

汎用ユーティリティ
関係演算子 (C++20で非推奨)
 
関数オブジェクト
関数の呼び出し
(C++17)(C++23)
恒等関数オブジェクト
(C++20)
透過的な演算子ラッパー
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)

古いバインダとアダプタ
(C++17まで*)
(C++17まで*)
(C++17まで*)
(C++17まで*)  
(C++17まで*)
mem_fun_tmem_fun1_tconst_mem_fun_tconst_mem_fun1_t
(C++17*まで)(C++17*まで)(C++17*まで)(C++17*まで)
(C++20まで*)
(C++20まで*)
(C++17*まで)(C++17*まで)
(C++17*まで)(C++17*まで)

(C++17まで*)
(C++17*まで)(C++17*まで)(C++17*まで)(C++17*まで)
(C++20まで*)
(C++20まで*)
 
ヘッダ <functional> で定義
template< class S, class T >

class mem_fun_t : public unary_function<T*,S> {
public:
    explicit mem_fun_t(S (T::*p)());
    S operator()(T* p) const;

};
(1) (C++11で非推奨)
(C++17で削除)
template< class S, class T >

class const_mem_fun_t : public unary_function<const T*,S> {
public:
    explicit const_mem_fun_t(S (T::*p)() const);
    S operator()(const T* p) const;

};
(2) (C++11で非推奨)
(C++17で削除)
template< class S, class T, class A >

class mem_fun1_t : public binary_function<T*,A,S> {
public:
    explicit mem_fun1_t(S (T::*p)(A));
    S operator()(T* p, A x) const;

};
(3) (C++11で非推奨)
(C++17で削除)
template< class S, class T, class A >

class const_mem_fun1_t : public binary_function<const T*,A,S> {
public:
    explicit const_mem_fun1_t(S (T::*p)(A) const);
    S operator()(const T* p, A x) const;

};
(4) (C++11で非推奨)
(C++17で削除)

メンバ関数ポインタのラッパー。呼び出すメンバ関数を持つクラスインスタンスは、operator() にポインタとして渡されます。

1) パラメータのない非 const メンバ関数をラップします。
2) パラメータのない const メンバ関数をラップします。
3) 1 つのパラメータを持つ非 const メンバ関数をラップします。
4) 1 つのパラメータを持つ const メンバ関数をラップします。

[編集] 関連項目

(C++11で非推奨)(C++17で削除)
オブジェクトへのポインタで呼び出し可能な、メンバ関数へのポインタからラッパーを生成する
(関数テンプレート) [編集]
オブジェクトへの参照で呼び出し可能な、引数なしまたは単項のメンバ関数へのポインタ用ラッパー
(クラステンプレート) [編集]
English 日本語 中文(简体) 中文(繁體)