std::shared_future::shared_future

shared_future();
(1) (C++11 起)
shared_future( const shared_future& other );
(2) (C++11 起)
shared_future( std::future<T>&& other );
(3) (C++11 起)
shared_future( shared_future&& other );
(4) (C++11 起)

构造新的 shared_future

1) 默认构造函数。构造空的 shared_future ,它不指代共享状态,即 valid() == false
2) 构造与 other 指代同一共享状态的 shared_future ,若有共享状态。
3-4) 转移 other 所保有的共享状态给 *this 。构造后, other.valid() == falsethis->valid() 返回与 other.valid() 在构造前会返回者相同的值。

参数

other - 用以初始化的另一期货对象

异常

1)
noexcept 规定:  
noexcept
  
2) (无)
(C++17 前)
2)
noexcept 规定:  
noexcept
  
(C++17 起)
3-4)
noexcept 规定:  
noexcept
  

版本历史

  • (当前 | 先前 2017年9月24日 (日) 08:36Fruderica讨论 | 贡献. . (1,154字节) (-888). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 11:35P12bot讨论 | 贡献 . . (2,042字节) (-142). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 18:45P12bot讨论 | 贡献 . . (2,184字节) (+369). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 03:32P12讨论 | 贡献 . . (1,815字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (1,815字节) (+1,815). . (Translated from the English version using Google Translate)