| Issue |
71761
|
| Summary |
`<ranges>`: `views::take`/`drop` should forward the `repeat_view`'s value member
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
hewillk
|
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
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs