AMCoded
AMCoded

Reputation: 1444

Dynamic control over execution policy type for C++

I noticed in c++ documents a class called execution_policy, which could be used for dynamic control of parallelism type or event turning it off, currently, I am using GCC 9.2 and I can't find this class or related header. Also noticed here there is changelog for removing it. Why class this useful need to be removed. Is there a replacement or an experimental version that I could use with GCC. If not what is the efficient way of implementing it?

Upvotes: 2

Views: 382

Answers (1)

Davis Herring
Davis Herring

Reputation: 40013

The dynamic execution_policy was deferred past C++17 (and 20) because it would require committing to an ABI for representing the various policies. (With only templates consuming them, any client contains its own copy appropriate to whatever representation it happens to use.) It is possible to choose policies dynamically, but you can’t make your own execution policy objects that could be passed to the standard algorithms (again, for future specification flexibility).

Upvotes: 2

Related Questions