The combinable<T> object is intended to provide thread-private copies of data, to perform lock-free thread-local sub-computations during parallel algorithms. At the end of the parallel operation, the thread-private sub-computations can then be merged into a final result. This class can be used instead of a shared variable, and can result in a performance improvement if there would otherwise be a lot of contention on that shared variable.
The data type of the final merged result. The type must have a copy constructor and a default constructor.
Clears any intermediate computational results from a previous usage.
Computes a final value from the set of thread-local sub-computations by calling the supplied combine functor.
Computes a final value from the set of thread-local sub-computations by calling the supplied combine functor once per thread-local sub-computation. The final result is accumulated by the function object.
Overloaded. Returns a reference to the thread-private sub-computation.