Can raw pointers be used instead of iterators with STL algorithms for containers with linear storage?
问题 I have a custom vector container that internally stores item a linear array. Last night, I was trying to implement custom iterators for my class to be able to use them with STL algorithms. I have had some success that you can see in here: Live example with custom iterators While doing so, I discovered I can merely pass raw pointers to STL algorithm and they just seem to work fine. Here's the example without any iterators: #include <cstddef> #include <iostream> #include <iterator> #include