Init
This commit is contained in:
35
cppdraft/exec/prop.md
Normal file
35
cppdraft/exec/prop.md
Normal file
@@ -0,0 +1,35 @@
|
||||
[exec.prop]
|
||||
|
||||
# 33 Execution control library [[exec]](./#exec)
|
||||
|
||||
## 33.11 Queryable utilities [[exec.envs]](exec.envs#exec.prop)
|
||||
|
||||
### 33.11.1 Class template prop [exec.prop]
|
||||
|
||||
namespace std::execution {template<class QueryTag, class ValueType>struct [prop](#lib:prop "33.11.1 Class template prop [exec.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>>;}
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L6193)
|
||||
|
||||
Class template prop is for building a queryable object
|
||||
from a query object and a value[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L6197)
|
||||
|
||||
*Mandates*: [*callable*](functional.syn#concept:callable "22.10.2 Header <functional> synopsis [functional.syn]")<QueryTag, *prop-like*<ValueType>> is modeled,
|
||||
where *prop-like* is the following exposition-only class template:template<class ValueType>struct *prop-like* { // *exposition only*const ValueType& query(auto) const noexcept;};
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L6209)
|
||||
|
||||
[*Example [1](#example-1)*: template<[sender](exec.snd.concepts#concept:sender "33.9.3 Sender concepts [exec.snd.concepts]") 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*]
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L6223)
|
||||
|
||||
Specializations of prop are not assignable[.](#4.sentence-1)
|
||||
Reference in New Issue
Block a user