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 , которая равна true , если T является стандартным типом политики выполнения или типом политики выполнения, определённым реализацией. В противном случае 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]
true если T является стандартным или определяемым реализацией типом политики выполнения, false в противном случае
(public static member constant)

Функции-члены

operator bool
преобразует объект в bool , возвращает value
(public member function)
operator()
(C++14)
возвращает value
(public member function)

Типы-члены

Тип Определение
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)
глобальные объекты политик выполнения
(константа)