# std::is_execution_policy

> C++ Atlas: `cppatlas.com/w/cpp/algorithm/is_execution_policy` | Source: https://en.cppreference.com/w/cpp/algorithm/is_execution_policy | Domain: Algorithms | Standards: C++14, C++17, C++20

Checks whether T is a standard or implementation-defined execution policy type.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <execution>

template< class T >
struct is_execution_policy; // (since C++17)
```

Checks whether `T` is a standard or implementation-defined execution policy type.

Provides the member constant `value` which is equal to `true`, if `T` is a standard execution policy type, or an implementation-defined execution policy type. Otherwise, `value` is equal to `false`.

If the program adds specializations for `std::is_execution_policy` or `std::is_execution_policy_v`, the behavior is undefined.

#### Template parameters

- `T` - a type to check

#### Helper template

```cpp
// Defined in header <execution>

template< class T >
constexpr bool is_execution_policy_v = std::is_execution_policy<T>::value; // (since C++17)
```

### Inherited from std::integral_constant

#### Member constants

- `value` [static]: `true` if `T` is a standard or implementation-defined execution policy type, `false` otherwise (public static member constant)

#### Member functions

- `operator bool`: converts the object to `bool`, returns `value` (public member function)
- `operator()` (C++14): returns `value` (public member function)

#### Member types

**Type — Definition**

- `value_type`: `bool`
- `type`: `std::integral_constant<bool, value>`

```cpp
#include <execution>

static_assert(std::is_execution_policy_v<std::execution::unsequenced_policy>);
static_assert(!std::is_execution_policy_v<int>);

int main() {}
```

#### See also

- [`sequenced_policy`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t) (C++17), [`parallel_policy`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t) (C++17), [`parallel_unsequenced_policy`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t) (C++17), [`unsequenced_policy`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t) (C++20): execution policy types (class)
- [`seq`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag) (C++17), [`par`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag) (C++17), [`par_unseq`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag) (C++17), [`unseq`](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag) (C++20): global execution policy objects (constant)

---
Attribution: content from https://en.cppreference.com/w/cpp/algorithm/is_execution_policy (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.