boost::ptr_array to use or not?
Hi,
I have an pointer array of objects as follows:
bucket * m_buckets[BUCKET_SIZE];
Because this array is a set size does it make sense to use a
boost::ptr_array?
boost::ptr_array
j.c. skrev:
Hi, I have an pointer array of objects as follows:
bucket * m_buckets[BUCKET_SIZE];
Because this array is a set size does it make sense to use a boost::ptr_array?
boost::ptr_array
m_buckets; * Note: One thing I first noticed with boost::array is that I cannot perform operations such as inserting at a desired index:
// Existing code. m_buckets[bit] = new bucket(k,v);
My goal is to use as many smart pointers as I can and less heap allocation.
m_buckets.replace<bit>( new bucket(k,v) );
or
m_buckets.replace( bit, new bucket(k.v) );
should work for boost::ptr_array
participants (2)
-
j.c.
-
Thorsten Ottosen