[PATCH v1 0/1] libstdc++: Simplify __memcpyable_iterators concept

tkaminsk via Sourceware Forge forge-bot+tkaminsk@forge-stage.sourceware.org
Wed Apr 22 18:02:23 GMT 2026


When we describe the lowering in the standard we require that `to_address(i + n)` is used, however the implementation currently calls only `i += n`. I do not think that difference between `i + n` and `i += n` is meanigfull, as at least for C++20 we require they to be semantically equivalent. However, `to_address(i + n)` is interesting, as it calls `i.operator->()` which may not throw, but still could terminate.

What do you think about updating the lines in the 3 functions that uses the `__memcpyable_iterators` to call:
```
std::to_address(__result += __n);
std::to_address(__first += __n);
``` 

--
https://forge.sourceware.org/gcc/gcc-TEST/pulls/38#issuecomment-710


More information about the Gcc-patches mailing list