I have the following code
int main() {
int x[2][3] = {{1,2,3},{4,5,6}};
struct testCase {
int** x;
};
vector<testCase> v = {{x}};
}
testCase
struct takes a 2D array as its member and I try to declare a vector of such struct. I compile the code with clang++ -std=c++11 -stdlib=libc++ test.cc
and obtain the error
test.cc:31:20: error: no matching constructor for initialization of 'vector<testCase>'
vector<testCase> v = {{x}};
^ ~~~~~
Since 2D array x
essentially has type int**
, I'm not sure why I hit such error in this use case.
Thanks in advance!