次の方法で共有


operator&& 演算子

引数として指定された両方のタスクが正常に完了したときに正常に完了するタスクを作成します。

template<
   typename _ReturnType
>
task<std::vector<_ReturnType>> operator&&(
   const task<_ReturnType> & _Lhs,
   const task<_ReturnType> & _Rhs
);

template<
   typename _ReturnType
>
task<std::vector<_ReturnType>> operator&&(
   const task<std::vector<_ReturnType>> & _Lhs,
   const task<_ReturnType> & _Rhs
);

template<
   typename _ReturnType
>
task<std::vector<_ReturnType>> operator&&(
   const task<_ReturnType> & _Lhs,
   const task<std::vector<_ReturnType>> & _Rhs
);

template<
   typename _ReturnType
>
task<std::vector<_ReturnType>> operator&&(
   const task<std::vector<_ReturnType>> & _Lhs,
   const task<std::vector<_ReturnType>> & _Rhs
);

inline task<void> operator&&(
   const task<void> & _Lhs,
   const task<void> & _Rhs
);

パラメーター

  • _ReturnType
    返されるタスクの種類。

  • _Lhs
    結果のタスクにまとめられる最初のタスク。

  • _Rhs
    結果のタスクにまとめられる 2 番目のタスク。

戻り値

入力した両方のタスクが正常に完了したときに正常に完了するタスク。 入力したタスクの種類が T である場合、この関数の出力は task<std::vector<T>> になります。 入力したタスクの種類が void である場合、出力のタスクも task<void> になります。

解説

タスクのどちらか 1 つが取り消された場合、または例外をスローした場合、返されるタスクは早期に完了し、取り消された状態になります。また例外が発生したときは、そのタスクに対して get() または wait() を呼び出す場合に、その例外がスローされます。

必要条件

ヘッダー: ppltasks.h

名前空間: concurrency

参照

関連項目

concurrency 名前空間

概念

タスクの並列化 (同時実行ランタイム)