is_placeholder Class

如果类型是占位符,测试。

template<class Ty>
    struct is_placeholder {
    static const int value;
    };

备注

如果类型 Ty 不是占位符,常数值 value 为0;否则,其值为的位置函数调用它所绑定到的参数。 您使用它确定第n占位符的 _N值 N。

示例

 

// std_tr1__functional__is_placeholder.cpp 
// compile with: /EHsc 
#include <functional> 
#include <iostream> 
 
using namespace std::placeholders; 
 
template<class Expr> 
    void test_for_placeholder(const Expr&) 
    { 
    std::cout << std::is_placeholder<Expr>::value << std::endl; 
    } 
 
int main() 
    { 
    test_for_placeholder(3.0); 
    test_for_placeholder(_3); 
 
    return (0); 
    } 
 
  

要求

标头: <functional>

命名空间: std

请参见

参考

_1 Object