Prefix operator++ should return the iterator incremented by reference.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
What is the context here? Did it cause any crash/bug or were you just reading through the code for a good night sleep? :D
Comment Actions
No crashes this time 🙏, just happened to notice it with @baloghadamsoftware.
Actually I was debugging thru iterator-related code and was making assumptions on the signature of operators.
Then I noticed the assymetry of return types in case of operator++ (fundamental types have ref return values in prefix case, but the simulator header did not for iterators).
Note that the libc++ implementation uses reference return types:
https://github.com/llvm/llvm-project/blob/master/libcxx/include/iterator
So does the libstd++ implementation:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/stl_iterator.h