search for: safeforeach

Displaying 1 result from an estimated 1 matches for "safeforeach".

2012 Jul 16
3
[LLVMdev] RFC: LLVM incubation, or requirements for committing new backends
...+} > + > +// Unlike the STL, a pointer to the iterator itself is passed in with the 'safe' > +// versions of these functions This allows the function to handle situations > +// such as invalidated iterators > +template<class InputIterator, class Function> > +Function safeForEach(InputIterator First, InputIterator Last, Function F) > +{ > + for ( ; First!=Last; ++First ) F(&First) > + ; // Do nothing. > + return F; > +} > + > +// A template function that has two levels of looping before calling the > +// function with a pointer to the curre...