
25 Nov
2006
25 Nov
'06
1:44 a.m.
sorry i want to know how to insert them not to how to copy tehm . like Container of boost of array .
vector<boost::array<int, 4> > v; v.push_back({4, 9, 11, 19});
chun ping wang wrote: this line: vector<int> v(a.begin(), a.end()); actually creates a vector with the data of the array. the copy(...) line was just "a test" to show that the content of v was 1, 2, 3, 4... array<int, 4> a = {0, 1, 2, 3}; // create int array with values 0 ... 3 vector<int> v(a.begin(), a.end()); // create vector and copy values from array to vector the "blabla copy" line would be equal to for (size_t loop = 0; loop < v.size(); ++loop) { cout << loop << "\n"; } is this what you ment, or else i'm sorry, i'm missing your point? -- regards, dave