std::promise::operator=

promise& operator=( promise&& other ) noexcept;
(1) (C++11 起)
promise& operator=( const promise& rhs ) = delete;
(2) (C++11 起)

赋值内容。

1) 移动赋值运算符。首先,抛弃共享状态(如在 ~promise() 中),然后如同以执行 std::promise(std::move(other)).swap(*this) 对共享状态赋值。
2) std::promise 不可复制赋值。

参数

other - 另一 std::promise 对象,为获取状态的来源

返回值

*this

版本历史

  • (当前 | 先前 2017年9月25日 (一) 00:49Fruderica讨论 | 贡献 . . (708字节) (-307). . (撤销)
  • 当前 | 先前 2017年9月16日 (六) 05:292001:da8:8000:e082::9933讨论. . (1,015字节) (-229). . (将英文版本人工翻译为中文) (撤销)
  • 当前 | 先前 2013年7月2日 (二) 11:33P12bot讨论 | 贡献 . . (1,244字节) (-90). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 19:16P12bot讨论 | 贡献 . . (1,334字节) (+289). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 03:08P12讨论 | 贡献 . . (1,045字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (1,045字节) (+1,045). . (Translated from the English version using Google Translate)