Skip to content

Latest commit

 

History

History
77 lines (59 loc) · 1.94 KB

File metadata and controls

77 lines (59 loc) · 1.94 KB

prop

  • execution[meta header]
  • class template[meta id-type]
  • std::execution[meta namespace]
  • cpp26[meta cpp]
namespace std::execution {
  template<class QueryTag, class ValueType>
  struct prop {
    QueryTag query_;   // exposition only
    ValueType value_;  // exposition only

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

  template<class QueryTag, class ValueType>
  prop(QueryTag, ValueType) -> prop<QueryTag, unwrap_reference_t<ValueType>>;
}
  • unwrap_reference_t[link /reference/type_traits/unwrap_reference.md]

概要

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{});
}
  • ex::prop[color ff0000]
  • std::get_stop_token[link ../get_stop_token.md]
  • std::never_stop_token[link /reference/stop_token/never_stop_token.md]

出力

バージョン

言語

  • C++26

処理系

関連項目

参照