From 1a805a7f89eb765ea4e3a2d0c6f8e939a3cce464 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 23 Jun 2023 23:38:51 +0200 Subject: [PATCH] P2538R1 ADL-proof std::projected --- source/iterators.tex | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 0a3eb7dd14..21f233d8be 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -2512,16 +2512,18 @@ \indexlibraryglobal{projected}% \begin{codeblock} namespace std { - template<@\libconcept{indirectly_readable}@ I, @\libconcept{indirectly_regular_unary_invocable}@ Proj> - struct projected { - using value_type = remove_cvref_t>; - indirect_result_t operator*() const; // \notdef + template + struct @\exposidnc{projected-impl}@ { // \expos + struct @\exposidnc{type}@ { // \expos + using value_type = remove_cvref_t>; + using difference_type = iter_difference_t; // present only if \tcode{I} + // models \libconcept{weakly_incrementable} + indirect_result_t operator*() const; // \notdef + }; }; - template<@\libconcept{weakly_incrementable}@ I, class Proj> - struct incrementable_traits> { - using difference_type = iter_difference_t; - }; + template<@\libconcept{indirectly_readable}@ I, @\libconcept{indirectly_regular_unary_invocable}@ Proj> + using projected = @\exposid{projected-impl}@::@\exposid{type}@; } \end{codeblock}