You cannot store arrays in vector or any other container. The type of elements to be stored in the container (called the container's value type) must be both constructive and assignable. Arrays are also not.
However, you can use an array class template such as the one provided by Boost, TR1, and C ++ 0x:
std::vector<std::array<double, 4> >
(You want to replace std::array with std::tr1::array to use the template included in C ++ TR1, or boost::array to use the template from the Boost library . Alternatively, you can write your own, it's pretty simple.)
James McNellis Jan 6 '11 at 6:18 2011-01-06 06:18
source share