mercredi 2 octobre 2019

Cannot define a 3D vector in a struct

When i define my vector in this way

#include<iostream>
#include<vector>
using namespace std;
typedef std::vector<char> Image1D;
typedef std::vector<Image1D> Image2D;
typedef std::vector<Image2D> Image3D;

int main()
{

  Image3D image2(10, std::vector<std::vector<char>>(10, std::vector<char>(10, 0)));
  return 0;
}

every thing works fine but when i define the same vector in a struct if give me some error in terms of type specifier it have problem with this const value 10

#include<iostream>
#include<vector>

using namespace std;
typedef std::vector<char> Image1D;
typedef std::vector<Image1D> Image2D;
typedef std::vector<Image2D> Image3D;




struct CameraImages
{
   Image3D image2(10, std::vector<std::vector<char>>(10, std::vector<char>(10, 0)));
};

any help would be highly appreciated

Aucun commentaire:

Enregistrer un commentaire