Renato Golin
2014-Mar-01 22:06 UTC
[LLVMdev] C++11 is here!!! (and it looks like it'll stay!)
On 1 March 2014 19:24, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:> for (auto V : X.foo()) { > ... > }+1 --renato
Sent from my iPhone> On Mar 1, 2014, at 2:06 PM, Renato Golin <renato.golin at linaro.org> wrote: > >> On 1 March 2014 19:24, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote: >> for (auto V : X.foo()) { >> ... >> }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 For (auto& bb : MF) Will iterate the BBs in a machine function forwards. How should we do it backwards? Whatever we choose should be the standard across other similar classes of this in different parts of the code base. I have 3 potential answers which are all quite similar. 1: for (auto& bb : MF.reverse()) 2: for (auto& bb : MF.r_bb()) 3: for (auto& bb : reverse(MF)) Personally I like 1 but I'm open to suggestions. Arguably 3 could also use 1 is people liked both. 2 is more explicit about what's going on but I don't like the style too much. Pete> > +1 > > --renato > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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