[Insight-developers] VectorContainer: Reserve, Squeeze, Resize

Brad King brad.king@kitware.com
Tue, 27 Feb 2001 13:41:25 -0500 (EST)


Luis,

> Is there an equivalent to stl resize in VectorContainer ?
No.  I originally designed the VectorContainer for use in static Mesh
instances (for example, ones using DefaultStaticMeshType).  Its purpose
was to allocate all the memory needed for a Mesh of predetermined size, be
filled, and then never be resized again.  If there are going to be many
changes to the mesh, the plan was to create it using
DefaultDynamicMeshType, which uses MapContainer instead, since insertions
and deletions are much faster.

Does anyone have any thoughts on adding a Resize() method to
VectorContainer?  It must be used with care, just as in the stl vector's
resize method, but this addition could increase the range of uses for the
container.

-Brad