Issues

Issue #87 open

Using memcpy to copy a vector

Anonymous created an issue

In http://www.arcsynthesis.org/gltut/Positioning/Tutorial%2003.html, Example 3.2, this: #!c++ memcpy(&fNewData[0], vertexPositions, sizeof(vertexPositions));

should really be this: #!c++ std::copy(vertexPositions, vertexPositions+sizeof(vertexPositions), fNewData.begin());

or even better: #!c++ std::vector<float> fNewData(vertexPositions, vertexPositions+sizeof(vertexPositions));

(std::begin / std::end could be used, but I doubt the tutorials should require C++11 compliance)

Comments (1)

  1. Log in to comment