Standard algorithms and execution policies
What are execution policies?
C++17 has brought some interesting additions to STL algorithms. One of which are execution policies. This is a set of tags that some STL algorithms accept as first argument (there’s an additional overload provided), instructing how container elements will be accessed and processed. C++17 added three distinct execution policies and one more came along with C++20. As of now, the list contains the following:
class sequenced_policy
,class parallel_policy
,class parallel_unsequenced_policy
,class unsequenced_policy
.
Terms
The description of these policies can be a bit intimidating and unfamiliar at first glance. Let’s take the description for parallel_policy
: