C++ STL: Can arrays be used transparently with STL functions?

后端 未结 11 1316
半阙折子戏
半阙折子戏 2020-12-15 17:07

I was under the assumption that STL functions could be used only with STL data containers (like vector) until I saw this piece of code:

#include         


        
11条回答
  •  死守一世寂寞
    2020-12-15 17:46

    Yes and this is on purpose. Iterators can be implemented as pointers and therefore you can use pointers as iterators.

提交回复
热议问题