When I use this, I guess it's safe to say those objects are aligned:
std::vector<object_type> vect;
I spotted an allocator in bullet physics, and I don't know how they work. This also raises the question about std::vector.
In the demo here, line 42, http://code.google.com/p/bullet/source/browse/trunk/Demos/BasicDemo/BasicDemo.h#42
btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
the type is a pointer, and later those pointer are assigned a new
. Does it really guarantee alignment ? If the allocator is made to deal with pointers, I guess yes, but I don't have any allocator knowledge, on top of that I don't know what is obsolete or not.
What about std::vector
? If I declare
std::vector<object_type*> vect;
and assign later, will the compiler still align my objects ?