Caching the end iterator - Good idea or Bad Idea?

前端 未结 8 1743
臣服心动
臣服心动 2021-02-04 03:36

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:



        
8条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 03:59

    If we are talking about efficiency and speed: caching the end iterator is unnecessary because of compiler optimizations and inlining.

提交回复
热议问题