title: What is the efficient way to copy vectors of one data type into a vector of struct of the same data type?
body: <p>I have a a vector of struct with 3 member variables <strong>(vec3)pos (vec3)norm (vec2)texCoord</strong> and I have have 3 other independent vectors of <strong>(vec3)x (vec3)y (vec2)z</strong> respectively, I want to copy/combine 
  the data from the independent vectors into the vector of the struct data type that I have mentioned above so that the variables will be aligned in accordance to the variables in the struct. 
  I can archieve this by iterating through each member of the vectors and assign the variables, however Iam looking for a faster more efficient approach to copy the whole range of a vector to the other vector with one or two function calls is there such a way to achieve this?</p>
  
  <p>pseudo code:</p>
  
  <pre><code>struct foo
  {
  vec3 pos;
  vec3 norm;
  vec2 texCoord;
  }
  
  vector&lt;foo&gt; attributes;
  
  vector&lt;vec3&gt; x;
  vector&lt;vec3&gt; y;
  vector&lt;vec2&gt; z;
  
  copy(x, attributes, offsetof(foo::pos), stride);
  copy(y, attributes, offsetof(foo::norm), stride);
  copy(z, attributes, offsetof(foo::texCoord), stride);
  </code></pre>