Usually like this:
#include <boost/assign/std/vector.hpp>
vector<int> v;
v += 1,2,3,4,5;
Except for a:
#include <boost/ptr_container/ptr_vector.hpp>
boost::ptr_vector<int> v;
If you need to know the reason; I'm using ptr_vector
instead of vector
only so I don't have to delete elements, but I need to initialize it using Boost.Assign as I want the ptr_vector
to be const
(can't use push_back()
or pop_back()
anywhere else in code.)
Thanks in advance for you answers, it's possible I'm using the wrong container type?