The following (contrived example) does not compile in MSVC with /std:c++latest
(tested in VS 2019 16.10.3):
#include <vector>
int main() {
std::vector<int[2]> v(2);
}
failing with C2440: 'return': cannot convert from int *
to _Ty (*)
(with _Ty=int [2]
, in a placement new statement, for context).
Is this a known bug? Is there a drop-in workaround without falling back to an old standard? (vector::resize
doesn't work either.)