is_bind_expression 类
测试通过调用 bind
是否生成类型。
语法
template<class Ty>
struct is_bind_expression {
static const bool value;
};
备注
如果类型 Ty
是调用 bind
返回的类型,则常量成员 value
为 true,否则为 false。
示例
// std__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);
}
0
1
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈