I have this call to the sort C++ algorithm:
std::sort(std::execution::par_unseq, vec.begin(), vec.end());
Now I would like to parametrize the execution policy:
std::sort(executionPolicy, vec.begin(), vec.end());
However, std::execution::seq, std::execution::par, std::execution::par_unseq, std::execution::unseq are objects of different type, respectively: std::execution::sequenced_policy, std::execution::parallel_policy, std::execution::parallel_unsequenced_policy, std::execution::unsequenced_policy.
How can I use a variable to store objects belonging to different classes which do not share a base class?