std::packaged_task::operator()
来自cppreference.com
< cpp | thread | packaged task
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
void operator()( ArgTypes... args ); |
(C++11 起) | |
Calls the stored task with args
as the arguments. The return value of the task or any exceptions thrown are stored in the shared state. The shared state is made ready and any threads waiting for this are unblocked.
目录 |
[编辑] 。参数。
args | - | 。参数传递调用的存储任务。
原文: the parameters to pass on invocation of the stored task |
===。 返回值。===
。 (无)。
[编辑] 。例外。
。 std::future_error下面的错误情况。
原文:
std::future_error on the following error conditions:
- 。已经调用存储的任务。错误类别设置为promise_already_satisfied.原文:The stored task has already been invoked. The error category is set to promise_already_satisfied.
[编辑] 。注释。
A successful call to opetator()
synchronizes with a call to any member function of a std::future or std::shared_future that share their shared state with *this.
[编辑] 。为例。
本章尚未完成 原因:暂无示例 |
[编辑] 。另请参阅。
执行的结果是只有一次准备退出当前线程的功能 原文: executes the function ensuring that the result is ready only once the current thread exits (公共成员函数) |