<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71761>71761</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`<ranges>`: `views::take`/`drop` should forward the `repeat_view`'s value member
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hewillk
</td>
</tr>
</table>
<pre>
https://github.com/llvm/llvm-project/blob/8a454e1e3cda98017401b22911ae23c67c7b31b0/libcxx/include/__ranges/take_view.h#L313-L316
https://github.com/llvm/llvm-project/blob/8a454e1e3cda98017401b22911ae23c67c7b31b0/libcxx/include/__ranges/drop_view.h#L279-L282
The current wording specifies `*E.value_`, where `E` is the expression implying that we should forward the value.
This means the following code is valid:
```cpp
#include <ranges>
#include <memory>
int main() {
auto t = std::views::repeat(std::make_unique<int>(5), 4) | std::views::take(2);
auto d = std::views::repeat(std::make_unique<int>(5), 4) | std::views::drop(2);
}
```
https://godbolt.org/z/M4d344anz
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVE2TpCgQ_TXphegKSPwoDx5qutpT723vFShZJTsoLmDZPb9-A-3Z6e2oy152IwwUUh4vk_dShWBuE1EDxTcozpla4uB8M9BqrP2edU6_N0OMcwB5AmwB25uJw9IdejcCttbef76eZu_-oD4Ctp11HWB7VHmRkyDZa1UfuahyLjrEWghFKPuy6qtOio4nANP1b2-ArZl6u2gCbC8Xr6YbBcA2qu90uRtaDwOgfJVCPr1KUQI_Az_t4__OUXs3f-KIVf30ikf8zPH3gVi_eE9TZKvz2kw3FmbqzdVQYFBywNPL4a7sQpdt9szWgTyl0AuUnJnA4kCM3mZPIRg3MTPO9j3hxEFFthILg1usZlfnV-X19vsGePhJwQQ2kpp2pKuz1q1pf-80Jfy7skanOu68S74__Tx_rKD8SJ-BfP7IXr48Co40Ov_-K7iNZopsVGYCPALWDKpv-zpjaomORQbyzELcKMhTqmfYPz3NpCLg8e_gmFSxTObPhUA-mymmo_BYANapdPmO__wQLSkK0vVgDfKfFPR_RCEJ5isFqM5fCv9Q3U53zsaD8zfA9gdg-1uuZZ6r6UemG6lrWauMGlHWdV7XRYHZ0FSVoC7PS45lj13dc9KcrjovKtVVV6Ez0yBHKQSvuRQo8aAqrehYqr7QVVleJeScRmXsIRkpnZ2ZEBZqKlGVIrOqIxu2LoI40cq2ICCmpuKbzXzdcguQc2tCDL9QoomWmpTqZz2l6SkJ_-ulJV-0UPKtfCV_JHgo-X5Vmx-3HVXYbcBGGjvyLFu8_fd9bcspmX3L-a8AAAD__w-tk38">