I was going through copy_If definition in cpprefrence , I saw that there are some constructs which are dependent upon execution _policy .I searched about it ,but I didn't get any good explanation . can somebody help me understand what is this and how it can be useful ?
Link : http://en.cppreference.com/w/cpp/algorithm/copy
Example :
template< class ExecutionPolicy, class ForwardIt1, class ForwardIt2, class UnaryPredicate >
ForwardIt2 copy_if( ExecutionPolicy&& policy, ForwardIt1 first, ForwardIt1 last,
ForwardIt2 d_first,
UnaryPredicate pred )
In a nutshell, the idea is that instead of just having your current thread execute the plain-vanilla version of the algorithm (well, plain-vanilla up to compiler optimizations), you could instead put your computing hardware to more extensive use, to complete the "algorithm" faster.
Examples of what kinds of "faster" might be available to you via an execution policy:
Commenters @UnholySheep and @DanM have given us the link to some (longer and more detailed) official documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With