// since C++11
#include <iostream>
#include <vector>
#include <iterator>
int main()
{
std::vector< int > v = { 3, 1, 4 }; // such assignment is supported since C++11
auto vi = std::begin( v );
std::cout << *vi << '\n';
int a[] = { -5, 10, 15 };
auto ai = std::begin( a );
std::cout << *ai << '\n';
return 0;
}
C++ STL的迭代器(iterator)
最新推荐文章于 2023-10-22 20:08:13 发布