Exceptions

This section touches upon the exceptions that can arise while using execution policies.

We'll cover the following

When using execution policies, you need to be pre​pared for two kinds of situations.

  • the scheduler or the implementation fails to allocate resources for the invocation - then std::bad_alloc is thrown.
  • an exception is thrown from the user code (a functor) - in that case, the exception is not re-thrown, std::terminate() is called.

Example

Get hands-on with 1400+ tech skills courses.