#include <cstdio> #include <iostream> #include <sstream> #include <vector> #include <boost/array.hpp> using namespace std; using namespace boost; int main() { boost::array<int, 5>barray = { 1,2,3,4,5 }; barray[0] = 10; barray.at(4) = 20; int *p = barray.data();//存储数组的指针 for (int i = 0; i < barray.size(); i++) { std::cout << barray[i] << " " << p[i] << std::endl; } return EXIT_SUCCESS; }