名前空間
変種
操作

std::is_bind_expression

提供: cppreference.com
< cpp‎ | utility‎ | functional
2012年10月26日 (金) 07:00時点におけるTranslationBot (トーク | 投稿記録)による版

(差分) ←前の版 | 最新版 (差分) | 次の版→ (差分)

 
 
ユーティリティライブラリ
汎用ユーティリティ
日付と時間
関数オブジェクト
書式化ライブラリ (C++20)
(C++11)
関係演算子 (C++20で非推奨)
整数比較関数
(C++20)
スワップと型操作
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
一般的な語彙の型
(C++11)
(C++17)
(C++17)
(C++17)
(C++17)

初等文字列変換
(C++17)
(C++17)
 
関数オブジェクト
関数ラッパー
(C++11)
(C++11)
関数の部分適用
(C++20)
(C++11)
is_bind_expression
(C++11)
関数呼び出し
(C++17)
恒等関数オブジェクト
(C++20)
参照ラッパー
(C++11)(C++11)
演算子ラッパー
否定子
(C++17)
検索子
制約付き比較子
古いバインダとアダプタ
(C++17未満)
(C++17未満)
(C++17未満)
(C++17未満)
(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未満)
 
Defined in header <functional>
template< class T >
struct is_bind_expression;
(C++11以上)
Tstd::bindの呼び出しによって生成された型である場合、このテンプレートは、メンバ定数value等しいtrueを提供しています。その他のタイプのために、valuefalseです.
Original:
If T is the type produced by a call to std::bind, this template provides the member constant value equal true. For any other type, value is false.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
バインドで生成された関数オブジェクトが呼び出されたときに、このタイプのバインド引数が、関数として呼び出されます:このテンプレートは、それがバインド部分式のタイプであったかのようにstd::bindによって扱われるべきであるユーザー定義型に特化することができるオブジェクトとバインドで生成したオブジェクトに渡されたすべてのバインドされていない引数が与えられます.
Original:
This template may be specialized for a user-defined type which should be treated by std::bind as if it was the type of a bind subexpression: when a bind-generated function object is invoked, a bound argument of this type will be invoked as a function object and will be given all the unbound arguments passed to the bind-generated object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

std::integral_constant から継承

メンバ定数

value
[静的]
T is a function object generated by std::bindならば true、そうでなければ false
(パブリック静的メンバ定数)

メンバ関数

operator bool
オブジェクトを bool に変換します。 value を返します
(パブリックメンバ関数)
operator()
(C++14)
value を返します
(パブリックメンバ関数)

メンバ型

定義
value_type bool
type std::integral_constant<bool, value>

#include <iostream>
#include <type_traits>
#include <functional>
 
struct MyBind {
    typedef int result_type;
    int operator()(int a, int b) const { return a + b; }
};
 
namespace std {
    template<>
    struct is_bind_expression<MyBind> : public true_type {};
}
 
int f(int n1, int n2)
{
    return n1+n2;
}
 
int main()
{
    // as if bind(f, bind(MyBind::operator(), _1, _2), 2)
    auto b = std::bind(f, MyBind(), 2); 
 
    std::cout << "Adding 2 to the sum of 10 and 11 gives " << b(10, 11) << '\n';
}

出力:

Adding 2 to the sum of 10 and 11 gives 23

も参照してください

テンプレート:cpp/utility/functional/dcl list bind