最終更新日時(UTC):
が更新

履歴 編集

class template
<execution>

std::execution::prop(C++26)

namespace std::execution {
  template<class QueryTag, class ValueType>
  struct prop {
    QueryTag query_;   // exposition only
    ValueType value_;  // exposition only

    constexpr const ValueType& query(QueryTag) const noexcept {
      return value_;
    }
  };

  template<class QueryTag, class ValueType>
  prop(QueryTag, ValueType) -> prop<QueryTag, unwrap_reference_t<ValueType>>;
}

概要

QueryTagクエリオブジェクトのキーとValueType型の値から、クエリ可能オブジェクトを構築する。

適格要件

説明用のprop-likeテンプレートクラスを用いて、QueryTagValueTypecallable<QueryTag, prop-like<ValueType>>のモデルであること。

template<class ValueType>
struct prop-like {
  const ValueType& query(auto) const noexcept;
};

#include <stop_token>
#include <execution>
namespace ex = std::execution;

int main()
{
  auto env0 = ex::prop(std::get_stop_token, std::never_stop_token{});
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照