The std::valarray class + std::gslice can be used for administrating 2D, 3D … ND matrices.
http://en.cppreference.com/w/cpp/numeric/valarray
http://en.cppreference.com/w/cpp/numeric/valarray/gslice
See some example in the link.
If your intention is the image manipulation refer to the specific specialized libraries (jpeg, png ….).
2
solved No 2D Image container in c++ [closed]