I particularly like the simplicity of using STL containers in the straightforward way.
I have never really figured out how to get the Boost library working on my dev platforms, in fact I don't think I've even tried. I guess you could say I am just trying to delay the inevitable since Boost is clearly a helpful library that I should be using.
But my question is essentially the same as this topic: http://stackoverflow.com/questions/2580189/how-to-initialise-a-stl-vector-list-with-a-class-without-invoking-the-copy-constr
I have std::list<ExpensiveClass> mylist;
and I just want a function that pushes a new instance into the list and calls the default constructor, rather than copying it from a temporary stack instance of it. In the other topic there was mention of move constructors. I looked them up and quite frankly it does nothing but strike fear into my heart. Two ampersands!!
Would it work if I just made an array of ExpensiveClass objects? ExpensiveClass *mylist = new ExpensiveClass[20];
Does this call the constructor 20 times?
Seems to me I should just use boost:ptr_list.