#include <boost/array.hpp>

Boost的array,元素可以是std::string

 1 #include <iostream>
 2 #include <string>
 3 #include <boost/array.hpp>
 4 
 5 void main()
 6 {
 7     boost::array<int, 5>barray = { 1,2,3,4,5 };
 8 
 9     barray[0] = 10;
10 
11     barray.at(4) = 20;
12 
13     int *p = barray.data();//存储数组的指针
14 
15     for (int i = 0; i < barray.size(); i++)
16     {
17         std::cout << barray[i] << " " << p[i] << std::endl;
18     }
19 
20     boost::array<std::string, 3>cmd = { "calc","notepad","tasklist" };
21 }
原文地址:https://www.cnblogs.com/denggelin/p/5767055.html