Generally speaking is it a good idea to cache an end iterator (specifically STL containers) for efficiency and speed purposes? such as in the following bit of code:
If we are talking about efficiency and speed: caching the end iterator is unnecessary because of compiler optimizations and inlining.