Skip to content

P2538R1 ADL-proof std::projected #6349

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

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2512,16 +2512,18 @@
\indexlibraryglobal{projected}%
\begin{codeblock}
namespace std {
template<@\libconcept{indirectly_readable}@ I, @\libconcept{indirectly_regular_unary_invocable}@<I> Proj>
struct projected {
using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>;
indirect_result_t<Proj&, I> operator*() const; // \notdef
template<class I, class Proj>
struct @\exposidnc{projected-impl}@ { // \expos
struct @\exposidnc{type}@ { // \expos
using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>;
using difference_type = iter_difference_t<I>; // present only if \tcode{I}
// models \libconcept{weakly_incrementable}
indirect_result_t<Proj&, I> operator*() const; // \notdef
};
};

template<@\libconcept{weakly_incrementable}@ I, class Proj>
struct incrementable_traits<projected<I, Proj>> {
using difference_type = iter_difference_t<I>;
};
template<@\libconcept{indirectly_readable}@ I, @\libconcept{indirectly_regular_unary_invocable}@<I> Proj>
using projected = @\exposid{projected-impl}@<I, Proj>::@\exposid{type}@;
}
\end{codeblock}

Expand Down