2.0 KiB
[exec.prop]
33 Execution control library [exec]
33.11 Queryable utilities [exec.envs]
33.11.1 Class template prop [exec.prop]
namespace std::execution {template<class QueryTag, class ValueType>struct prop { QueryTag query_; // exposition only ValueType value_; // exposition onlyconstexpr const ValueType& query(QueryTag) const noexcept {return value_; }}; template<class QueryTag, class ValueType> prop(QueryTag, ValueType) -> prop<QueryTag, unwrap_reference_t>;}
Class template prop is for building a queryable object from a query object and a value.
Mandates: callable<QueryTag, prop-like> is modeled, where prop-like is the following exposition-only class template:templatestruct prop-like { // exposition onlyconst ValueType& query(auto) const noexcept;};
[Example 1: template<sender Sndr> sender auto parameterize_work(Sndr sndr) {// Make an environment such that get_allocator(env) returns a reference to a copy of my_alloc{}.auto e = prop(get_allocator, my_alloc{}); // Parameterize the input sender so that it will use our custom execution environment.return write_env(sndr, e);} â end example]
Specializations of prop are not assignable.