-
Notifications
You must be signed in to change notification settings - Fork 778
P3433R1 Allocator Support for Operation States #8002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AlisdairM
wants to merge
1
commit into
cplusplus:main
Choose a base branch
from
AlisdairM:apply_p3433_allocator_support_for_operation_states
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1819,7 +1819,7 @@ | |||||
\begin{codeblock} | ||||||
[]<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept -> decltype(auto) { | ||||||
auto& [_, data, ...child] = sndr; | ||||||
return std::forward_like<Sndr>(data); | ||||||
return @\exposid{allocator-aware-forward}@(std::forward_like<Sndr>(data), rcvr); | ||||||
} | ||||||
\end{codeblock} | ||||||
|
||||||
|
@@ -1916,6 +1916,36 @@ | |||||
\end{itemize} | ||||||
\end{itemdescr} | ||||||
|
||||||
\begin{itemdecl} | ||||||
template<class T, class Context> | ||||||
decltype(auto) @\exposid{allocator-aware-forward}@(T&& obj, Context&& context); // \expos | ||||||
\end{itemdecl} | ||||||
|
||||||
\begin{itemdescr} | ||||||
\pnum | ||||||
\exposid{allocator-aware-forward} is an exposition-only function used to | ||||||
either create a new object of type \tcode{T} from \tcode{obj} | ||||||
or forward \tcode{obj} depending on whether an allocator is available. | ||||||
If the environment associated with context provides an allocator | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "context" should be code font:
Suggested change
|
||||||
(i.e., the expression \tcode{get_allocator(get_env(context))} is valid, | ||||||
let \exposid{alloc} be the result of this expression | ||||||
and \tcode{P} be \tcode{remove_cvref_t<T>}. | ||||||
|
||||||
\pnum | ||||||
\returns | ||||||
\begin{itemize} | ||||||
\item | ||||||
If \exposid{alloc} is not defined, returns \tcode{std::forward<T>(obj)}, | ||||||
\item | ||||||
otherwise if \tcode{P} is a specialization of \exposid{product-type}, | ||||||
returns an object of type \tcode{P} whose elements are initialized using | ||||||
\tcode{make_obj_using_allocator<decltype(e)> (std::forward_like<T>(e), \exposid{alloc})} | ||||||
where \tcode{e} is the corresponding element of \tcode{obj}, | ||||||
\item | ||||||
otherwise, returns \tcode{make_obj_using_allocator<P>(std::forward<T>(obj), \exposid{alloc})}. | ||||||
\end{itemize} | ||||||
\end{itemdescr} | ||||||
|
||||||
\rSec2[exec.snd.concepts]{Sender concepts} | ||||||
|
||||||
\pnum | ||||||
|
@@ -3515,7 +3545,8 @@ | |||||
args_variant_t @\exposid{args}@; // \expos | ||||||
ops2_variant_t @\exposid{ops2}@; // \expos | ||||||
}; | ||||||
return @\exposid{state-type}@{std::forward_like<Sndr>(fn), @\exposid{let-env}@(child), {}, {}}; | ||||||
return @\exposid{state-type}@{@\exposid{allocator-aware-forward}@(std::forward_like<Sndr>(fn), rcvr), | ||||||
@\exposid{let-env}@(child), {}, {}}; | ||||||
} | ||||||
\end{codeblock} | ||||||
|
||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent by two