Namespaces
Variants

std:: is_execution_policy

From cppreference.net
Algorithm library
Constrained algorithms and algorithms on ranges (C++20)
Constrained algorithms, e.g. ranges::copy , ranges::sort , ...
Execution policies (C++17)
is_execution_policy
(C++17)
Non-modifying sequence operations
Batch operations
(C++17)
Search operations
Modifying sequence operations
Copy operations
(C++11)
(C++11)
Swap operations
Transformation operations
Generation operations
Removing operations
Order-changing operations
(until C++17) (C++11)
(C++20) (C++20)
Sampling operations
(C++17)

Sorting and related operations
Partitioning operations
Sorting operations
Binary search operations
(on partitioned ranges)
Set operations (on sorted ranges)
Merge operations (on sorted ranges)
Heap operations
Minimum/maximum operations
Lexicographical comparison operations
Permutation operations
C library
Numeric operations
Operations on uninitialized memory
定义于头文件 <execution>
template < class T >
struct is_execution_policy ;
(C++17 起)

检查 T 是否为标准或实现定义的执行策略类型。

提供成员常量 value ,当 T 标准执行策略类型 或实现定义的执行策略类型时,该常量等于 true 。否则, value 等于 false

如果程序为 std::is_execution_policy std::is_execution_policy_v 添加特化,则行为是未定义的。

目录

模板参数

T - 待检查的类型

辅助模板

定义于头文件 <execution>
template < class T >
constexpr bool is_execution_policy_v = std :: is_execution_policy < T > :: value ;
(C++17 起)

继承自 std:: integral_constant

成员常量

value
[static]
T 是标准或实现定义的执行策略类型则为 true ,否则为 false
(公开静态成员常量)

成员函数

operator bool
转换对象为 bool 类型,返回 value
(公开成员函数)
operator()
(C++14)
返回 value
(公开成员函数)

成员类型

类型 定义
value_type bool
type std:: integral_constant < bool , value >
#include <execution>
static_assert(std::is_execution_policy_v<std::execution::unsequenced_policy>);
static_assert(!std::is_execution_policy_v<int>);
int main() {}

参见

执行策略类型
(类)
(C++17) (C++17) (C++17) (C++20)
全局执行策略对象
(常量)