Following declaration passes compilation check:
int arr[3];
vector<int[3]> vec; // ok !!
When trying to use vec practically as,
vec.push_back(arr);
it results in many error like:
/usr/include/c++/4.6/ext/new_allocator.h:108:9: error: ISO C++ forbids initialization in array new [-fpermissive]
/usr/include/c++/4.6/bits/vector.tcc:314:4: error: invalid array assignment
/usr/include/c++/4.6/ext/new_allocator.h:118:30: error: request for member ‘~int [3]’ in ‘* __p’, which is of non-class type ‘int [3]’
Additionally, vec doesn't push_back() the int* also.
What exactly goes wrong here ? Is such issue being addressed in C++11 ?
push_backwhich is why your code compiles without it.