On 3 March 2014 12:13, Pete Cooper <peter_cooper at apple.com> wrote:> It would also be good to agree on a way to handle reverse iterators, especially on those which already use begin() and end() for going forwards. For examplerbegin() and rend()? --renato
Sent from my iPhone>> On Mar 2, 2014, at 8:26 PM, Renato Golin <renato.golin at linaro.org> wrote: >> >> On 3 March 2014 12:13, Pete Cooper <peter_cooper at apple.com> wrote: >> It would also be good to agree on a way to handle reverse iterators, especially on those which already use begin() and end() for going forwards. For example > > rbegin() and rend()?Would those work with a foreach construct? Perhaps I forgot to mention that was what I'm trying to work out here. In example 3 I was wondering if we could define a method reverse(). We could use sfinae to wrap that around rbegin/rend if people like that style? Pete> > --renato
On 3 March 2014 12:32, Pete Cooper <peter_cooper at apple.com> wrote:> Would those work with a foreach construct? Perhaps I forgot to mention that was what I'm trying to work out here. > > In example 3 I was wondering if we could define a method reverse(). We could use sfinae to wrap that around rbegin/rend if people like that style?Sorry, I was too terse... ;) If MF is a reverse_iterator, it'd just work, no? But to get the reverse iterator, I think reverse() would be the best general pattern, since you can adapt it to each container needs. cheers, --renato
Possibly Parallel Threads
- [LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
- [LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
- [LLVMdev] C++11 reverse iterators (was C++11 is here)
- [LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
- [LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)