- 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テンプレートクラスを用いて、QueryTagとValueTypeがcallable<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
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??