Effectively our own custom std::packaged_task<>, with copy semantics and letting us early set value to significantly improve performance. More...
Effectively our own custom std::packaged_task<>, with copy semantics and letting us early set value to significantly improve performance.
class R | The return type of the callable which must be without parameters. Unlike `std::packaged_task<>`, this custom variant is copyable though each copy always refers to the same internal state. Early stl_future value setting is possible, with any subsequent value setting including that by the function being executed being ignored. Note that this behaviour opens the potential to lose exception state - if you set the stl_future value early and then an exception is later thrown, the exception is swallowed. |
January, 2014 |
Copyright © 2013-2014 Niall Douglas, Cork, Ireland Copyright © 2013 Paul Kirth, California |