1 #include <iostream> 2 #include <string> 3 #include<boost/array.hpp>//区别 4 using namespace std; 5 6 void main() 7 { 8 boost::array<int, 10> myarray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 9 boost::array<int, 10>::iterator ibegin = myarray.begin(); 10 boost::array<int, 10>::iterator iend = myarray.end(); 11 for (;ibegin!=iend;ibegin++) 12 { 13 cout << *ibegin << endl; 14 } 15 cin.get(); 16 }