std::vector, Box2D, and User Pointer

It’s a bad idea to put objects directly in vectors and set user pointer to their addresses since when the vector grows, their addresses will change.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.