is_bind_expression クラス

更新 : 2007 年 11 月

型が bind の呼び出しによって生成されたかどうかをテストします。

template<class Ty>
    struct is_bind_expression {
    static const bool value;
    };

解説

定数値 value は、型 Ty が、bind の呼び出しから返された型である場合は true、それ以外の場合は 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::tr1::is_bind_expression<Expr>::value << std::endl; 
    } 
 
int main() 
    { 
    test_for_bind(3.0 * 3.0); 
    test_for_bind(std::tr1::bind(square, 3)); 
 
    return (0); 
    } 
 
0
1

必要条件

ヘッダー : <functional>

名前空間 : std::tr1

参照

参照

<functional> (TR1)

bind 関数