is_bind_expression 類別
測試,如果呼叫所產生的 bind型別。
template<class Ty>
struct is_bind_expression {
static const bool value;
};
備註
常數值 value 為 true,如果型別是 Ty 呼叫所傳回的型別設定為 bind,否則為 false。
範例
// std_tr1__functional__is_bind_expression.cpp
// compile with: /EHsc
#include <functional>
#include <iostream>
void square(double x)
{
std::cout << x << "^2 == " << x * x << std::endl;
}
template<class Expr>
void test_for_bind(const Expr&)
{
std::cout << std::is_bind_expression<Expr>::value << std::endl;
}
int main()
{
test_for_bind(3.0 * 3.0);
test_for_bind(std::bind(square, 3));
return (0);
}
需求
標題: <functional>
命名空間: std