The struct memory can be packed using compile instruction
#pragma pack(push,1)
struct vertex
{
int x,y,z;
};
#pragma pack(pop,1)
The vector stores the data continuously, which can be verified using the following simple program:
#include <iostream>
#include <vector>
using namespace std;
#pragma pack(push,1)
struct vtx
{
int x,y,z;
};
#pragma pack(pop,1)
main()
{
vector<vtx> v(3);
v[0].x=v[0].y=v[0].z=1;
v[1].x=v[1].y=v[1].z=2;
v[2].x=v[2].y=v[2].z=3;
int *p=&v[0].x;
for(int i=0;i<9;i++) cout<<*p++<<endl;
}
The output would be:
1
1
1
2
2
2
3
3
3
So the answer is yes.